Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
cb202161
Commit
cb202161
authored
Apr 03, 2013
by
Tom Christie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #776 from atlefren/master
Proper import of errors from oauth_provider
parents
a18d3df0
80d28de0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
rest_framework/authentication.py
+2
-2
No files found.
rest_framework/authentication.py
View file @
cb202161
...
@@ -230,7 +230,7 @@ class OAuthAuthentication(BaseAuthentication):
...
@@ -230,7 +230,7 @@ class OAuthAuthentication(BaseAuthentication):
try
:
try
:
consumer_key
=
oauth_request
.
get_parameter
(
'oauth_consumer_key'
)
consumer_key
=
oauth_request
.
get_parameter
(
'oauth_consumer_key'
)
consumer
=
oauth_provider_store
.
get_consumer
(
request
,
oauth_request
,
consumer_key
)
consumer
=
oauth_provider_store
.
get_consumer
(
request
,
oauth_request
,
consumer_key
)
except
oauth_provider
_
store
.
InvalidConsumerError
as
err
:
except
oauth_provider
.
store
.
InvalidConsumerError
as
err
:
raise
exceptions
.
AuthenticationFailed
(
err
)
raise
exceptions
.
AuthenticationFailed
(
err
)
if
consumer
.
status
!=
oauth_provider
.
consts
.
ACCEPTED
:
if
consumer
.
status
!=
oauth_provider
.
consts
.
ACCEPTED
:
...
@@ -240,7 +240,7 @@ class OAuthAuthentication(BaseAuthentication):
...
@@ -240,7 +240,7 @@ class OAuthAuthentication(BaseAuthentication):
try
:
try
:
token_param
=
oauth_request
.
get_parameter
(
'oauth_token'
)
token_param
=
oauth_request
.
get_parameter
(
'oauth_token'
)
token
=
oauth_provider_store
.
get_access_token
(
request
,
oauth_request
,
consumer
,
token_param
)
token
=
oauth_provider_store
.
get_access_token
(
request
,
oauth_request
,
consumer
,
token_param
)
except
oauth_provider
_
store
.
InvalidTokenError
:
except
oauth_provider
.
store
.
InvalidTokenError
:
msg
=
'Invalid access token:
%
s'
%
oauth_request
.
get_parameter
(
'oauth_token'
)
msg
=
'Invalid access token:
%
s'
%
oauth_request
.
get_parameter
(
'oauth_token'
)
raise
exceptions
.
AuthenticationFailed
(
msg
)
raise
exceptions
.
AuthenticationFailed
(
msg
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment