if else optimization (#8340)

Removed redundant parentheses
This commit is contained in:
Sevdimali 2022-01-27 19:02:20 +04:00 committed by GitHub
parent 02eeb6fa00
commit f378f98a40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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