summaryrefslogtreecommitdiff
path: root/django/views
diff options
context:
space:
mode:
authorTom Forbes <tom@tomforb.es>2020-07-13 08:01:59 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-07-13 08:06:21 +0200
commitf36862b69c3325da8ba6892a6057bbd9470efd70 (patch)
treefa4c2b2b27bba7c8b9ad402db1a795c2b0ef95a2 /django/views
parentb7a438c7e21cdcb26d47f1c1fc5afdc1b3d1a9ef (diff)
Fixed #31674 -- Made technical 500 debug page respect __suppress_context__.
Diffstat (limited to 'django/views')
-rw-r--r--django/views/debug.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/views/debug.py b/django/views/debug.py
index c85b86c913..68dba4b500 100644
--- a/django/views/debug.py
+++ b/django/views/debug.py
@@ -396,8 +396,9 @@ class ExceptionReporter:
def get_traceback_frames(self):
def explicit_or_implicit_cause(exc_value):
explicit = getattr(exc_value, '__cause__', None)
+ suppress_context = getattr(exc_value, '__suppress_context__', None)
implicit = getattr(exc_value, '__context__', None)
- return explicit or implicit
+ return explicit or (None if suppress_context else implicit)
# Get the exception and all its causes
exceptions = []