From 91e492bd2eccca9440597a005717db3413a70d00 Mon Sep 17 00:00:00 2001 From: Ryan P Kilby Date: Fri, 10 May 2019 10:43:07 -0700 Subject: [PATCH] Rollback #6435 Python 2 loses the exception context with an explicit `raise exc`, making debugging significantly more difficult. --- rest_framework/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/views.py b/rest_framework/views.py index 9d5d959e9..04951ed93 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -463,7 +463,7 @@ class APIView(View): renderer_format = getattr(request.accepted_renderer, 'format') use_plaintext_traceback = renderer_format not in ('html', 'api', 'admin') request.force_plaintext_errors(use_plaintext_traceback) - raise exc + raise # Note: Views are made CSRF exempt from within `as_view` as to prevent # accidental removal of this exemption in cases where `dispatch` needs to