1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

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__.
This commit is contained in:
Adam Johnson
2021-03-17 10:55:00 +00:00
committed by Mariusz Felisiak
parent 4a80d0f220
commit 0c0b87725b
3 changed files with 9 additions and 2 deletions

View File

@@ -20,6 +20,9 @@ else:
def get_view_name(view_func):
if hasattr(view_func, 'view_class'):
klass = view_func.view_class
return f'{klass.__module__}.{klass.__qualname__}'
mod_name = view_func.__module__
view_name = getattr(view_func, '__qualname__', view_func.__class__.__name__)
return mod_name + '.' + view_name