Resolve infinite recursion on illegal logins

This commit is contained in:
andrew committed 2023-03-16 16:50:57 -04:00
1 parent 6592360ac3
commit b18cbce31f
1 file changed
+3 -2
+3 -2
View File
@@ -161,7 +161,7 @@ def login(request, error=''):
# # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
if request.method == 'GET': if request.method == 'GET' or error:
data = { 'error' : error } data = { 'error' : error }
return render(request, 'login.html', data, always_allow=True) return render(request, 'login.html', data, always_allow=True)
@@ -171,7 +171,8 @@ def login(request, error=''):
return django.http.HttpResponseRedirect('/index/') return django.http.HttpResponseRedirect('/index/')
except UnableToAuthenticate: 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): def logout(request):