Commit 8b4ce5c6 by Tom Christie

Minor authentication message improvement.

parent d015534d
{"last_check":"2015-02-04T09:06:02Z","pypi_version":"6.0.7"}
\ No newline at end of file
...@@ -86,8 +86,13 @@ class BasicAuthentication(BaseAuthentication): ...@@ -86,8 +86,13 @@ class BasicAuthentication(BaseAuthentication):
Authenticate the userid and password against username and password. Authenticate the userid and password against username and password.
""" """
user = authenticate(username=userid, password=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.')) raise exceptions.AuthenticationFailed(_('Invalid username/password.'))
if not user.is_active:
raise exceptions.AuthenticationFailed(_('User inactive or deleted.'))
return (user, None) return (user, None)
def authenticate_header(self, request): def authenticate_header(self, request):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment