Skip to content

Commit 8b4ce5c

Browse files
committed
Minor authentication message improvement.
1 parent d015534 commit 8b4ce5c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

env/pip-selfcheck.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"last_check":"2015-02-04T09:06:02Z","pypi_version":"6.0.7"}

rest_framework/authentication.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,13 @@ def authenticate_credentials(self, userid, password):
8686
Authenticate the userid and password against username and password.
8787
"""
8888
user = authenticate(username=userid, password=password)
89-
if user is None or not user.is_active:
89+
90+
if user is None:
9091
raise exceptions.AuthenticationFailed(_('Invalid username/password.'))
92+
93+
if not user.is_active:
94+
raise exceptions.AuthenticationFailed(_('User inactive or deleted.'))
95+
9196
return (user, None)
9297

9398
def authenticate_header(self, request):

0 commit comments

Comments
 (0)