Refactor CBV schema method limitation for set operations

This commit is contained in:
hurturk 2017-05-02 17:34:53 -04:00
parent 2196cd2bbb
commit 6075f8051a

View File

@ -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