captcha: Fix issue with captcha path when captcha entered is wrong

Signed-off-by: Joseph Nuthalpati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Joseph Nuthalpati authored and James Valleroy committed 2017-10-17 22:07:22 -04:00
1 parent 62f26433e8
commit 6e26c92441
2 files changed
+3 -1

No files matched your search

+2 -1
View File
@@ -62,7 +62,8 @@ class SSOLoginView(LoginView):
if request.user.is_authenticated:
return set_ticket_cookie(request.user, response)
else: # Redirect user to captcha page
return HttpResponseRedirect('captcha')
redirect = '' if request.path.rstrip('/').endswith('captcha') else 'captcha'
return HttpResponseRedirect(redirect)
return response