From 6e26c92441bcfb41b77931876282a89ad502c8a4 Mon Sep 17 00:00:00 2001 From: Joseph Nuthalpati Date: Tue, 22 Aug 2017 15:38:40 +0530 Subject: [PATCH] captcha: Fix issue with captcha path when captcha entered is wrong Signed-off-by: Joseph Nuthalpati Reviewed-by: James Valleroy --- plinth/__main__.py | 1 + plinth/modules/sso/views.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plinth/__main__.py b/plinth/__main__.py index c97ba4d37..8fb8c3d3a 100644 --- a/plinth/__main__.py +++ b/plinth/__main__.py @@ -244,6 +244,7 @@ def configure_django(): CACHES={'default': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}}, CAPTCHA_FONT_PATH=['/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf'], + CAPTCHA_LENGTH=6, DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': cfg.store_file}}, diff --git a/plinth/modules/sso/views.py b/plinth/modules/sso/views.py index 57ecba6fb..c9615c289 100644 --- a/plinth/modules/sso/views.py +++ b/plinth/modules/sso/views.py @@ -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