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
89e9fc98
Commit
89e9fc98
authored
Dec 14, 2014
by
José Padilla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reuse exception_handler variable throughout
parent
fd003fce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
rest_framework/views.py
+5
-3
No files found.
rest_framework/views.py
View file @
89e9fc98
...
...
@@ -371,16 +371,18 @@ class APIView(View):
else
:
exc
.
status_code
=
status
.
HTTP_403_FORBIDDEN
if
len
(
inspect
.
getargspec
(
self
.
settings
.
EXCEPTION_HANDLER
)
.
args
)
==
1
:
exception_handler
=
self
.
settings
.
EXCEPTION_HANDLER
if
len
(
inspect
.
getargspec
(
exception_handler
)
.
args
)
==
1
:
warnings
.
warn
(
'The `exception_handler(exc)` call signature is deprecated. '
'Use `exception_handler(exc, context) instead.'
,
PendingDeprecationWarning
)
response
=
self
.
settings
.
EXCEPTION_HANDLER
(
exc
)
response
=
exception_handler
(
exc
)
else
:
context
=
self
.
get_renderer_context
()
response
=
self
.
settings
.
EXCEPTION_HANDLER
(
exc
,
context
)
response
=
exception_handler
(
exc
,
context
)
if
response
is
None
:
raise
...
...
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