File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,13 @@ def __init__(self, drf_router=None):
2121 else :
2222 self .get_all_view_names (root_urlconf .urlpatterns )
2323
24- def get_all_view_names (self , urlpatterns , parent_pattern = None ):
24+ def get_all_view_names (self , urlpatterns , parent_regex = None ):
2525 for pattern in urlpatterns :
2626 if isinstance (pattern , RegexURLResolver ):
27- parent_pattern = None if pattern ._regex == "^" else pattern
28- self .get_all_view_names (urlpatterns = pattern .url_patterns , parent_pattern = parent_pattern )
27+ regex = '' if pattern ._regex == "^" else pattern . _regex
28+ self .get_all_view_names (urlpatterns = pattern .url_patterns , parent_regex = parent_regex + regex )
2929 elif isinstance (pattern , RegexURLPattern ) and self ._is_drf_view (pattern ) and not self ._is_format_endpoint (pattern ):
30- api_endpoint = ApiEndpoint (pattern , parent_pattern , self .drf_router )
30+ api_endpoint = ApiEndpoint (pattern , parent_regex , self .drf_router )
3131 self .endpoints .append (api_endpoint )
3232
3333 def _is_drf_view (self , pattern ):
You can’t perform that action at this time.
0 commit comments