Skip to content

Commit 4d68fa7

Browse files
Merge pull request #55 from docc/master
Force method names to string.
2 parents 9a85323 + 81e0735 commit 4d68fa7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rest_framework_docs/api_endpoint.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
import inspect
33
from django.contrib.admindocs.views import simplify_regex
4+
from django.utils.encoding import force_str
45

56

67
class ApiEndpoint(object):
@@ -25,7 +26,7 @@ def __get_path__(self, parent_pattern):
2526
return simplify_regex(self.pattern.regex.pattern)
2627

2728
def __get_allowed_methods__(self):
28-
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)]
2930

3031
def __get_docstring__(self):
3132
return inspect.getdoc(self.callback)

0 commit comments

Comments
 (0)