Commit 6075f805 by hurturk

Refactor CBV schema method limitation for set operations

parent 2196cd2b
...@@ -246,10 +246,9 @@ class EndpointInspector(object): ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment