Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions rest_framework_docs/api_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ def __get_path__(self, parent_pattern):

def __get_allowed_methods__(self):
callback_cls = self.callback.cls
return sorted([force_str(m).upper() for m in callback_cls.http_method_names if hasattr(callback_cls, m) or
(issubclass(callback_cls, ModelViewSet) and m in VIEWSET_METHODS.get(self.callback.suffix))])
return sorted(
[force_str(m).upper() for m in callback_cls.http_method_names
if hasattr(callback_cls, m) or (issubclass(callback_cls, ModelViewSet)
and m in VIEWSET_METHODS.get(self.callback.suffix, ''))])

def __get_docstring__(self):
return inspect.getdoc(self.callback)
Expand Down