mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-25 11:04:02 +03:00
Rollback #6435
Python 2 loses the exception context with an explicit `raise exc`, making debugging significantly more difficult.
This commit is contained in:
parent
7f16ed7727
commit
91e492bd2e
|
@ -463,7 +463,7 @@ class APIView(View):
|
||||||
renderer_format = getattr(request.accepted_renderer, 'format')
|
renderer_format = getattr(request.accepted_renderer, 'format')
|
||||||
use_plaintext_traceback = renderer_format not in ('html', 'api', 'admin')
|
use_plaintext_traceback = renderer_format not in ('html', 'api', 'admin')
|
||||||
request.force_plaintext_errors(use_plaintext_traceback)
|
request.force_plaintext_errors(use_plaintext_traceback)
|
||||||
raise exc
|
raise
|
||||||
|
|
||||||
# Note: Views are made CSRF exempt from within `as_view` as to prevent
|
# Note: Views are made CSRF exempt from within `as_view` as to prevent
|
||||||
# accidental removal of this exemption in cases where `dispatch` needs to
|
# accidental removal of this exemption in cases where `dispatch` needs to
|
||||||
|
|
Loading…
Reference in New Issue
Block a user