summaryrefslogtreecommitdiff
path: root/django/views/debug.py
diff options
context:
space:
mode:
authorKeryn Knight <keryn@kerynknight.com>2022-01-07 12:57:03 +0000
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-01-08 14:54:10 +0100
commit2ea0321058a3ba04306f8e6b9d1e1aa99e164a3f (patch)
tree05a43a78940169cb06a6021961b65804f253b306 /django/views/debug.py
parentc959aa99aa365c123a3b5ca72df9d07e0e3fe6e5 (diff)
[4.0.x] Fixed #33425 -- Fixed view name for CBVs on technical 404 debug page.
Regression in 0c0b87725bbcffca3bc3a7a2c649995695a5ae3b. Backport of 2a66c102d9c674fadab252a28d8def32a8b626ec from main
Diffstat (limited to 'django/views/debug.py')
-rw-r--r--django/views/debug.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/views/debug.py b/django/views/debug.py
index 16c9ad7fc8..2a4593e87e 100644
--- a/django/views/debug.py
+++ b/django/views/debug.py
@@ -545,8 +545,9 @@ def technical_404_response(request, exception):
obj = resolver_match.func
if hasattr(obj, 'view_class'):
- caller = obj.view_class
- elif hasattr(obj, '__name__'):
+ obj = obj.view_class
+
+ if hasattr(obj, '__name__'):
caller = obj.__name__
elif hasattr(obj, '__class__') and hasattr(obj.__class__, '__name__'):
caller = obj.__class__.__name__