From 65017c73d99ab5b175b6ef3528baa98eed1f91f5 Mon Sep 17 00:00:00 2001 From: Billy Ferguson Date: Thu, 10 Oct 2019 15:08:46 -0400 Subject: [PATCH] Checks allowed methods against http method names and upper cases them for downstream usage. --- rest_framework/schemas/generators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/schemas/generators.py b/rest_framework/schemas/generators.py index 77e92eeb8..e1f33780b 100644 --- a/rest_framework/schemas/generators.py +++ b/rest_framework/schemas/generators.py @@ -138,7 +138,7 @@ class EndpointEnumerator: http_method_names = set(callback.cls.http_method_names) methods = [method.upper() for method in actions & http_method_names] else: - methods = callback.cls().allowed_methods + methods = [method.upper() for method in callback.cls().allowed_methods & http_method_names] return [method for method in methods if method not in ('OPTIONS', 'HEAD')]