mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 11:33:59 +03:00
Clean up some print and comments
This commit is contained in:
parent
653fcf7e33
commit
d4c2267187
|
@ -175,7 +175,6 @@ class OAuth2Authentication(BaseAuthentication):
|
||||||
http://tools.ietf.org/html/rfc6749#section-7.1
|
http://tools.ietf.org/html/rfc6749#section-7.1
|
||||||
"""
|
"""
|
||||||
auth = request.META.get('HTTP_AUTHORIZATION', '').split()
|
auth = request.META.get('HTTP_AUTHORIZATION', '').split()
|
||||||
print auth
|
|
||||||
if not auth or auth[0].lower() != "bearer":
|
if not auth or auth[0].lower() != "bearer":
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -202,11 +201,6 @@ class OAuth2Authentication(BaseAuthentication):
|
||||||
raise exceptions.AuthenticationFailed("Invalid token") # does not exist or is expired
|
raise exceptions.AuthenticationFailed("Invalid token") # does not exist or is expired
|
||||||
|
|
||||||
# TODO check scope
|
# TODO check scope
|
||||||
# try:
|
|
||||||
# self.validate_token(request, consumer, token)
|
|
||||||
# except oauth2_provider.Error, e:
|
|
||||||
# print "got e"
|
|
||||||
# raise exceptions.AuthenticationFailed(e.message)
|
|
||||||
|
|
||||||
if not self.check_active(token.user):
|
if not self.check_active(token.user):
|
||||||
raise exceptions.AuthenticationFailed('User not active: %s' % token.user.username)
|
raise exceptions.AuthenticationFailed('User not active: %s' % token.user.username)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user