diff options
| author | Eric Buehl | 2014-03-05 17:15:52 +0000 |
|---|---|---|
| committer | Eric Buehl | 2014-03-05 17:15:52 +0000 |
| commit | e0682e9298092721c0d3eb358ce4be8039e7ccf6 (patch) | |
| tree | b5aba5e0e80e119aa49b551a4c7875bab1d235dc /rest_framework/authentication.py | |
| parent | 45ae5081f7d45438306a23a56f05a56e7681fa1e (diff) | |
| download | django-rest-framework-e0682e9298092721c0d3eb358ce4be8039e7ccf6.tar.bz2 | |
don't implicitly import provider.oauth2
Diffstat (limited to 'rest_framework/authentication.py')
| -rw-r--r-- | rest_framework/authentication.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rest_framework/authentication.py b/rest_framework/authentication.py index e491ce5f..b0e88d88 100644 --- a/rest_framework/authentication.py +++ b/rest_framework/authentication.py @@ -326,11 +326,11 @@ class OAuth2Authentication(BaseAuthentication): """ try: - token = oauth2_provider.models.AccessToken.objects.select_related('user') + token = oauth2_provider.oauth2.models.AccessToken.objects.select_related('user') # provider_now switches to timezone aware datetime when # the oauth2_provider version supports to it. token = token.get(token=access_token, expires__gt=provider_now()) - except oauth2_provider.models.AccessToken.DoesNotExist: + except oauth2_provider.oauth2.models.AccessToken.DoesNotExist: raise exceptions.AuthenticationFailed('Invalid token') user = token.user |
