summaryrefslogtreecommitdiff
path: root/django/urls/resolvers.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/urls/resolvers.py')
-rw-r--r--django/urls/resolvers.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/urls/resolvers.py b/django/urls/resolvers.py
index 110ad87cdb..2ef173c2c8 100644
--- a/django/urls/resolvers.py
+++ b/django/urls/resolvers.py
@@ -46,6 +46,8 @@ class ResolverMatch:
self.namespaces = [x for x in namespaces if x] if namespaces else []
self.namespace = ':'.join(self.namespaces)
+ if hasattr(func, 'view_class'):
+ func = func.view_class
if not hasattr(func, '__name__'):
# A class-based view
self._func_path = func.__class__.__module__ + '.' + func.__class__.__name__