From b18cbce31f366f303a7a054279649eaecba67af3 Mon Sep 17 00:00:00 2001 From: andrew Date: Thu, 16 Mar 2023 16:50:57 -0400 Subject: [PATCH] Resolve infinite recursion on illegal logins --- OpenBench/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenBench/views.py b/OpenBench/views.py index 3e0446f..f497b59 100644 --- a/OpenBench/views.py +++ b/OpenBench/views.py @@ -161,7 +161,7 @@ def login(request, error=''): # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - if request.method == 'GET': + if request.method == 'GET' or error: data = { 'error' : error } return render(request, 'login.html', data, always_allow=True) @@ -171,7 +171,8 @@ def login(request, error=''): return django.http.HttpResponseRedirect('/index/') except UnableToAuthenticate: - return index(request, error='Unable to Authenticate User') + data = { 'error' : 'Unable to authenticate username and password' } + return render(request, 'login.html', data, always_allow=True) def logout(request):