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
26c223a3
Commit
26c223a3
authored
Dec 14, 2014
by
José Padilla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add get_exception_handler_context()
parent
89e9fc98
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
+13
-1
rest_framework/views.py
+13
-1
No files found.
rest_framework/views.py
View file @
26c223a3
...
...
@@ -186,6 +186,18 @@ class APIView(View):
'request'
:
getattr
(
self
,
'request'
,
None
)
}
def
get_exception_handler_context
(
self
):
"""
Returns a dict that is passed through to EXCEPTION_HANDLER,
as the `context` argument.
"""
return
{
'view'
:
self
,
'args'
:
getattr
(
self
,
'args'
,
()),
'kwargs'
:
getattr
(
self
,
'kwargs'
,
{}),
'request'
:
getattr
(
self
,
'request'
,
None
)
}
def
get_view_name
(
self
):
"""
Return the view name, as used in OPTIONS responses and in the
...
...
@@ -381,7 +393,7 @@ class APIView(View):
)
response
=
exception_handler
(
exc
)
else
:
context
=
self
.
get_
render
er_context
()
context
=
self
.
get_
exception_handl
er_context
()
response
=
exception_handler
(
exc
,
context
)
if
response
is
None
:
...
...
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