Skip to content

Commit a9b7d1f

Browse files
Merge pull request #43 from annp89/feature/make-is_drf_view-more-pythonic
Make _is_drf_view more pythonic
2 parents 246a7a8 + 2118cc5 commit a9b7d1f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

rest_framework_docs/api_docs.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ def get_all_view_names(self, urlpatterns, parent_pattern=None):
2424

2525
def _is_drf_view(self, pattern):
2626
# Should check whether a pattern inherits from DRF's APIView
27-
if (hasattr(pattern.callback, 'cls') and issubclass(pattern.callback.cls, APIView)):
28-
return True
29-
return False
27+
return hasattr(pattern.callback, 'cls') and issubclass(pattern.callback.cls, APIView)
3028

3129
def get_endpoints(self):
3230
return self.endpoints

0 commit comments

Comments
 (0)