Minor authentication message improvement.

This commit is contained in:
Tom Christie 2015-02-04 09:07:10 +00:00
parent d015534d53
commit 8b4ce5c636
2 changed files with 7 additions and 1 deletions

1
env/pip-selfcheck.json vendored Normal file
View File

@ -0,0 +1 @@
{"last_check":"2015-02-04T09:06:02Z","pypi_version":"6.0.7"}

View File

@ -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):