Skip to content
Permalink
Browse files
disable login for suspended users
  • Loading branch information
usmannasir committed Jan 21, 2020
1 parent b51ef9d commit 4e783f0a2f11c9ec6dab6e576e0c907ff1304a36
Showing with 5 additions and 0 deletions.
  1. +5 −0 loginSystem/views.py
@@ -79,6 +79,11 @@ def verifyLogin(request):

admin = Administrator.objects.get(userName=username)

if admin.state == 'SUSPENDED':
data = {'userID': 0, 'loginStatus': 0, 'error_message': 'Account currently suspended.'}
json_data = json.dumps(data)
return HttpResponse(json_data)

if hashPassword.check_password(admin.password, password):

request.session['userID'] = admin.pk

0 comments on commit 4e783f0

Please sign in to comment.