Skip to content

Commit

Permalink
disable login for suspended users
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Jan 21, 2020
1 parent b51ef9d commit 4e783f0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions loginSystem/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e783f0

Please sign in to comment.