mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 17:09:59 +03:00
Moves http_method_names out to shared scope.
This commit is contained in:
parent
65017c73d9
commit
3034d0a919
|
@ -133,9 +133,9 @@ class EndpointEnumerator:
|
|||
"""
|
||||
Return a list of the valid HTTP methods for this endpoint.
|
||||
"""
|
||||
http_method_names = set(callback.cls.http_method_names)
|
||||
if hasattr(callback, 'actions'):
|
||||
actions = set(callback.actions)
|
||||
http_method_names = set(callback.cls.http_method_names)
|
||||
methods = [method.upper() for method in actions & http_method_names]
|
||||
else:
|
||||
methods = [method.upper() for method in callback.cls().allowed_methods & http_method_names]
|
||||
|
|
Loading…
Reference in New Issue
Block a user