|
|
|
@ -71,6 +71,13 @@ def signup(request):
|
|
|
|
|
|
|
|
|
|
form = SignupForm(request.POST)
|
|
|
|
|
|
|
|
|
|
grr = request.POST.get('g-recaptcha-response', '')
|
|
|
|
|
if captcha_test(grr, request):
|
|
|
|
|
request.session['signup_captcha_pass'] = True
|
|
|
|
|
elif not request.session.get('signup_captcha_pass'):
|
|
|
|
|
messages.error(request, _("Invalid captcha. Please try again"))
|
|
|
|
|
return render(request, 'ccvpn/signup.html', dict(form=form))
|
|
|
|
|
|
|
|
|
|
if not form.is_valid():
|
|
|
|
|
return render(request, 'ccvpn/signup.html', dict(form=form))
|
|
|
|
|
|
|
|
|
@ -92,6 +99,9 @@ def signup(request):
|
|
|
|
|
user.backend = 'django.contrib.auth.backends.ModelBackend'
|
|
|
|
|
auth.login(request, user)
|
|
|
|
|
|
|
|
|
|
# invalidate that captcha
|
|
|
|
|
request.session['signup_captcha_pass'] = False
|
|
|
|
|
|
|
|
|
|
return redirect('account:index')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|