We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9a85323 + 81e0735 commit 4d68fa7Copy full SHA for 4d68fa7
rest_framework_docs/api_endpoint.py
@@ -1,6 +1,7 @@
1
import json
2
import inspect
3
from django.contrib.admindocs.views import simplify_regex
4
+from django.utils.encoding import force_str
5
6
7
class ApiEndpoint(object):
@@ -25,7 +26,7 @@ def __get_path__(self, parent_pattern):
25
26
return simplify_regex(self.pattern.regex.pattern)
27
28
def __get_allowed_methods__(self):
- return [m.upper() for m in self.callback.cls.http_method_names if hasattr(self.callback.cls, m)]
29
+ return [force_str(m).upper() for m in self.callback.cls.http_method_names if hasattr(self.callback.cls, m)]
30
31
def __get_docstring__(self):
32
return inspect.getdoc(self.callback)
0 commit comments