Using user.get_username() instead of user.username.

This solves an error when using a auth model that does not have a username field.
This commit is contained in:
dpanesso 2014-09-03 23:38:03 -05:00
parent 840fe7b05c
commit 1ab782a430

View File

@ -344,7 +344,7 @@ class OAuth2Authentication(BaseAuthentication):
user = token.user
if not user.is_active:
msg = 'User inactive or deleted: %s' % user.username
msg = 'User inactive or deleted: %s' % user.get_username()
raise exceptions.AuthenticationFailed(msg)
return (user, token)