diff --git a/rest_framework/schemas/generators.py b/rest_framework/schemas/generators.py index e1f33780b..00d33a89a 100644 --- a/rest_framework/schemas/generators.py +++ b/rest_framework/schemas/generators.py @@ -133,9 +133,9 @@ class EndpointEnumerator: """ Return a list of the valid HTTP methods for this endpoint. """ + http_method_names = set(callback.cls.http_method_names) if hasattr(callback, 'actions'): actions = set(callback.actions) - http_method_names = set(callback.cls.http_method_names) methods = [method.upper() for method in actions & http_method_names] else: methods = [method.upper() for method in callback.cls().allowed_methods & http_method_names]