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/permissions.py | |
| parent | 45ae5081f7d45438306a23a56f05a56e7681fa1e (diff) | |
| download | django-rest-framework-e0682e9298092721c0d3eb358ce4be8039e7ccf6.tar.bz2 | |
don't implicitly import provider.oauth2
Diffstat (limited to 'rest_framework/permissions.py')
| -rw-r--r-- | rest_framework/permissions.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/rest_framework/permissions.py b/rest_framework/permissions.py index f24a5123..6460056a 100644 --- a/rest_framework/permissions.py +++ b/rest_framework/permissions.py @@ -8,8 +8,7 @@ import warnings SAFE_METHODS = ['GET', 'HEAD', 'OPTIONS'] from django.http import Http404 -from rest_framework.compat import (get_model_name, oauth2_provider_scope, - oauth2_constants) +from rest_framework.compat import (get_model_name, oauth2_provider) class BasePermission(object): @@ -219,8 +218,8 @@ class TokenHasReadWriteScope(BasePermission): if hasattr(token, 'resource'): # OAuth 1 return read_only or not request.auth.resource.is_readonly elif hasattr(token, 'scope'): # OAuth 2 - required = oauth2_constants.READ if read_only else oauth2_constants.WRITE - return oauth2_provider_scope.check(required, request.auth.scope) + required = oauth2_provider.constants.READ if read_only else oauth2_provider.constants.WRITE + return oauth2_provider.scope.check(required, request.auth.scope) assert False, ('TokenHasReadWriteScope requires either the' '`OAuthAuthentication` or `OAuth2Authentication` authentication ' |
