Cast allowed_methods to set for set diff.

This commit is contained in:
Billy Ferguson 2019-10-10 15:23:31 -04:00 committed by GitHub
parent 3034d0a919
commit 4666aae90c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,7 +138,8 @@ class EndpointEnumerator:
actions = set(callback.actions) actions = set(callback.actions)
methods = [method.upper() for method in actions & http_method_names] methods = [method.upper() for method in actions & http_method_names]
else: else:
methods = [method.upper() for method in callback.cls().allowed_methods & http_method_names] allowed_methods = set(callback.cls().allowed_methods)
methods = [method.upper() for method in allowed_methods & http_method_names]
return [method for method in methods if method not in ('OPTIONS', 'HEAD')] return [method for method in methods if method not in ('OPTIONS', 'HEAD')]