mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-23 23:12:59 +03:00
Refactor CBV schema method limitation for set operations
This commit is contained in:
parent
2196cd2bbb
commit
6075f8051a
|
@ -246,10 +246,9 @@ class EndpointInspector(object):
|
|||
Return a list of the valid HTTP methods for this endpoint.
|
||||
"""
|
||||
if hasattr(callback, 'actions'):
|
||||
return [
|
||||
method.upper() for method in
|
||||
set(callback.actions.keys()).intersection(set(callback.cls().http_method_names))
|
||||
]
|
||||
actions = set(callback.actions.keys())
|
||||
http_method_names = set(callback.cls().http_method_names)
|
||||
return [method.upper() for method in actions & http_method_names]
|
||||
|
||||
return [
|
||||
method for method in
|
||||
|
|
Loading…
Reference in New Issue
Block a user