Skip to content

Commit 4e783f0

Browse files
committed
disable login for suspended users
1 parent b51ef9d commit 4e783f0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

loginSystem/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ def verifyLogin(request):
7979

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

82+
if admin.state == 'SUSPENDED':
83+
data = {'userID': 0, 'loginStatus': 0, 'error_message': 'Account currently suspended.'}
84+
json_data = json.dumps(data)
85+
return HttpResponse(json_data)
86+
8287
if hashPassword.check_password(admin.password, password):
8388

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

0 commit comments

Comments
 (0)