Skip to content

Commit 9a9bac0

Browse files
author
Emmanouil Konstantinidis
committed
Remove excluded apps & endpoints - Checks if drf apiview
1 parent 9d7052b commit 9a9bac0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

rest_framework_docs/api_docs.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66

77
class ApiDocumentation(object):
8-
excluded_apps = ["admin", "rest_framework_docs"]
9-
excluded_endpoints = ["serve"]
108

119
def __init__(self):
1210
self.endpoints = []
@@ -15,9 +13,9 @@ def __init__(self):
1513

1614
def get_all_view_names(self, urlpatterns, parent_pattern=None):
1715
for pattern in urlpatterns:
18-
if isinstance(pattern, RegexURLResolver) and (pattern.app_name not in self.excluded_apps):
16+
if isinstance(pattern, RegexURLResolver):
1917
self.get_all_view_names(urlpatterns=pattern.url_patterns, parent_pattern=pattern)
20-
elif isinstance(pattern, RegexURLPattern) and (pattern.callback.__name__ not in self.excluded_endpoints) and self._is_drf_view(pattern):
18+
elif isinstance(pattern, RegexURLPattern) and self._is_drf_view(pattern):
2119
api_endpoint = ApiEndpoint(pattern, parent_pattern)
2220
self.endpoints.append(api_endpoint)
2321

0 commit comments

Comments
 (0)