From f378f98a401f28df4ef9bdaf3ee56a1017c195ab Mon Sep 17 00:00:00 2001 From: Sevdimali Date: Thu, 27 Jan 2022 19:02:20 +0400 Subject: [PATCH] if else optimization (#8340) Removed redundant parentheses --- rest_framework/decorators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/decorators.py b/rest_framework/decorators.py index 30b9d84d4..3b572c09e 100644 --- a/rest_framework/decorators.py +++ b/rest_framework/decorators.py @@ -142,7 +142,7 @@ def action(methods=None, detail=None, url_path=None, url_name=None, **kwargs): how the `@renderer_classes` etc. decorators work for function- based API views. """ - methods = ['get'] if (methods is None) else methods + methods = ['get'] if methods is None else methods methods = [method.lower() for method in methods] assert detail is not None, (