Repository files navigation def register_user(request):
if request.method == "POST":
form = SignUpForm(request.POST)
username = form.cleaned_data['username']
password = form.cleaned_data['password1']
user = authenticate(username=username, password=password)
messages.success(request, "You've successfully registered!")
return render(request, 'register.html',{'form':form})
return render(request, 'register.html',{'form':form})
def register_user(request):
if request.method == "POST":
form = SignUpForm(request.POST)
# Fetch the UserProfile for the newly registered user
# user_profile = UserProfile.objects.get(user=user)
# except UserProfile.DoesNotExist:
user_profile.objects.create(user=user)
username = form.cleaned_data['username']
password = form.cleaned_data['password1']
user = authenticate(username=username, password=password)
messages.success(request, "You've successfully registered!")
# If a UserProfile exists, associate it with the user
messages.error(request, "There was an error logging in, please try again...")
messages.error(request, "There was an error registering your account.")
return render(request, 'register.html', {'form': form})
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
You can’t perform that action at this time.