Resolve infinite recursion on illegal logins
This commit is contained in:
1 parent
6592360ac3
commit
b18cbce31f
1 file changed
+3
-2
+3
-2
@@ -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):
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user