<commit_before>from django.shortcuts import render
from django.views.generic import TemplateView, CreateView
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth import authenticate, login

from forms import *


# Create your views here.
class HomePageView(TemplateView):
    """
    TemplateView for Home Page

    Attributes:
        template_name (str): Template to be rendered
    """
    template_name = 'rockclimb/home.html'


class RegisterView(CreateView):
    """CreateView for User

    Attributes:
        form_class (UserCreateForm) = form class that creates a User
        model (User) = User object to create
        success_message (str) = Message upon form valid
        success_url (str) = Reverse to FeedView
        template_name (str): Generic template to be rendered
    """
    form_class = UserCreateForm
    model = User
    success_message = "Account created successfully!"
    success_url = reverse_lazy('home')
    template_name = 'registration/register.html'

    def form_valid(self, form):
        """
        If the form is valid, redirect to the supplied URL.

        This function also creates the user then logs them in
        """
        response =  super(RegisterView, self).form_valid(form)

        # Get the username and password created, log the user
        username = self.request.POST['username']
        password = self.request.POST['<PASSWORD>']
        user = authenticate(username=username, password=password)
        login(self.request, user)

        return response<commit_msg>Updated views.py to fix Arch linux bug<commit_after>from django.shortcuts import render
from django.views.generic import TemplateView, CreateView
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth import authenticate, login

from rockclimb.forms import *


# Create your views here.
class HomePageView(TemplateView):
    """
    TemplateView for Home Page

    Attributes:
        template_name (str): Template to be rendered
    """
    template_name = 'rockclimb/home.html'


class RegisterView(CreateView):
    """CreateView for User

    Attributes:
        form_class (UserCreateForm) = form class that creates a User
        model (User) = User object to create
        success_message (str) = Message upon form valid
        success_url (str) = Reverse to FeedView
        template_name (str): Generic template to be rendered
    """
    form_class = UserCreateForm
    model = User
    success_message = "Account created successfully!"
    success_url = reverse_lazy('home')
    template_name = 'registration/register.html'

    def form_valid(self, form):
        """
        If the form is valid, redirect to the supplied URL.

        This function also creates the user then logs them in
        """
        response =  super(RegisterView, self).form_valid(form)

        # Get the username and password created, log the user
        username = self.request.POST['username']
        password = self.request.POST['<PASSWORD>']
        user = authenticate(username=username, password=password)
        login(self.request, user)

        return response
{'fraction_non_alphanumeric': 0.07778131973222824, 'fraction_numerical': 0.0, 'mean_word_length': 3.080624187256177, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '773954', 'n_tokens_mistral': 832, 'n_tokens_neox': 798, 'n_words': 277}