diff options
| author | Tom Christie | 2015-02-04 09:07:10 +0000 |
|---|---|---|
| committer | Tom Christie | 2015-02-04 09:07:10 +0000 |
| commit | 8b4ce5c636a9abb33029e48f969bbdf38f97ca1f (patch) | |
| tree | ac1eb97df0d1e8a2a2e6a469c694b4d9fd9cbb86 /rest_framework/authentication.py | |
| parent | d015534d530dfdc2bbd7e301ec79fed533d55032 (diff) | |
| download | django-rest-framework-8b4ce5c636a9abb33029e48f969bbdf38f97ca1f.tar.bz2 | |
Minor authentication message improvement.
Diffstat (limited to 'rest_framework/authentication.py')
| -rw-r--r-- | rest_framework/authentication.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/rest_framework/authentication.py b/rest_framework/authentication.py index 11db0585..a75cd30c 100644 --- a/rest_framework/authentication.py +++ b/rest_framework/authentication.py @@ -86,8 +86,13 @@ class BasicAuthentication(BaseAuthentication): Authenticate the userid and password against username and password. """ user = authenticate(username=userid, password=password) - if user is None or not user.is_active: + + if user is None: raise exceptions.AuthenticationFailed(_('Invalid username/password.')) + + if not user.is_active: + raise exceptions.AuthenticationFailed(_('User inactive or deleted.')) + return (user, None) def authenticate_header(self, request): |
