diff options
| author | Adam Johnson <me@adamj.eu> | 2021-03-17 10:55:00 +0000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-30 06:51:27 +0200 |
| commit | 0c0b87725bbcffca3bc3a7a2c649995695a5ae3b (patch) | |
| tree | f38aa2381ae8b203ad7658dbac8ec00b2c4d849d /django/views/debug.py | |
| parent | 4a80d0f22021bb0af842f038eba45958e9576bec (diff) | |
Refs #32260 -- Made admindocs and technical 404 debug page use view_func.view_class.
Internals of admindocs and technical 404 debug page should use the
view_class attribute and do not rely on __name__.
Diffstat (limited to 'django/views/debug.py')
| -rw-r--r-- | django/views/debug.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/views/debug.py b/django/views/debug.py index e2f9ffe3e2..36abaf3121 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -517,7 +517,9 @@ def technical_404_response(request, exception): else: obj = resolver_match.func - if hasattr(obj, '__name__'): + if hasattr(obj, 'view_class'): + caller = obj.view_class + elif hasattr(obj, '__name__'): caller = obj.__name__ elif hasattr(obj, '__class__') and hasattr(obj.__class__, '__name__'): caller = obj.__class__.__name__ |
