We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fa5871a + 3441d6f commit eedcae5Copy full SHA for eedcae5
rest_framework_docs/api_endpoint.py
@@ -47,8 +47,10 @@ def __get_path__(self, parent_pattern):
47
48
def __get_allowed_methods__(self):
49
callback_cls = self.callback.cls
50
- return sorted([force_str(m).upper() for m in callback_cls.http_method_names if hasattr(callback_cls, m) or
51
- (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
52
+ if hasattr(callback_cls, m) or (issubclass(callback_cls, ModelViewSet)
53
+ and m in VIEWSET_METHODS.get(self.callback.suffix, ''))])
54
55
def __get_docstring__(self):
56
return inspect.getdoc(self.callback)
0 commit comments