diff --git a/rest_framework_docs/api_docs.py b/rest_framework_docs/api_docs.py index d22dd4c..06b969e 100644 --- a/rest_framework_docs/api_docs.py +++ b/rest_framework_docs/api_docs.py @@ -24,8 +24,8 @@ def __init__(self, drf_router=None): def get_all_view_names(self, urlpatterns, parent_pattern=None): for pattern in urlpatterns: if isinstance(pattern, RegexURLResolver): - parent_pattern = None if pattern._regex == "^" else pattern - self.get_all_view_names(urlpatterns=pattern.url_patterns, parent_pattern=parent_pattern) + parent_pattern_ = None if pattern._regex == "^" else pattern + self.get_all_view_names(urlpatterns=pattern.url_patterns, parent_pattern=parent_pattern_) elif isinstance(pattern, RegexURLPattern) and self._is_drf_view(pattern) and not self._is_format_endpoint(pattern): api_endpoint = ApiEndpoint(pattern, parent_pattern, self.drf_router) self.endpoints.append(api_endpoint)