mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-09-21 11:29:01 +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.
|
Return a list of the valid HTTP methods for this endpoint.
|
||||||
"""
|
"""
|
||||||
if hasattr(callback, 'actions'):
|
if hasattr(callback, 'actions'):
|
||||||
return [
|
actions = set(callback.actions.keys())
|
||||||
method.upper() for method in
|
http_method_names = set(callback.cls().http_method_names)
|
||||||
set(callback.actions.keys()).intersection(set(callback.cls().http_method_names))
|
return [method.upper() for method in actions & http_method_names]
|
||||||
]
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
method for method in
|
method for method in
|
||||||
|
|
Loading…
Reference in New Issue
Block a user