changed signup to accounts
finished fixing linting
This commit is contained in:
parent
4ab42bf3de
commit
d8853cee1c
11 changed files with 13 additions and 12 deletions
|
|
@ -1,20 +0,0 @@
|
|||
from django.contrib.auth import login
|
||||
from django.shortcuts import redirect, render
|
||||
|
||||
from .forms import RegistrationForm
|
||||
|
||||
|
||||
def signup(request):
|
||||
if request.method == 'POST':
|
||||
form = RegistrationForm(request.POST)
|
||||
if form.is_valid():
|
||||
user = form.save()
|
||||
user.first_name = form.cleaned_data.get('first_name')
|
||||
user.last_name = form.cleaned_data.get('last_name')
|
||||
user.email = form.cleaned_data.get('email')
|
||||
login(request, user)
|
||||
return redirect('/')
|
||||
return render(request, 'signup.html', {'form': form})
|
||||
else:
|
||||
form = RegistrationForm()
|
||||
return render(request, 'signup.html', {'form': form})
|
||||
Loading…
Add table
Add a link
Reference in a new issue