Skip to content

Commit e13d2af

Browse files
committed
Parens around if clause
1 parent d920683 commit e13d2af

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rest_framework/decorators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def api_view(http_method_names=None):
1818
Decorator that converts a function-based view into an APIView subclass.
1919
Takes a list of allowed methods for the view as an argument.
2020
"""
21-
http_method_names = ['GET'] if http_method_names is None else http_method_names
21+
http_method_names = ['GET'] if (http_method_names is None) else http_method_names
2222

2323
def decorator(func):
2424

@@ -112,7 +112,7 @@ def detail_route(methods=None, **kwargs):
112112
"""
113113
Used to mark a method on a ViewSet that should be routed for detail requests.
114114
"""
115-
methods = ['get'] if methods is None else methods
115+
methods = ['get'] if (methods is None) else methods
116116

117117
def decorator(func):
118118
func.bind_to_methods = methods
@@ -126,7 +126,7 @@ def list_route(methods=None, **kwargs):
126126
"""
127127
Used to mark a method on a ViewSet that should be routed for list requests.
128128
"""
129-
methods = ['get'] if methods is None else methods
129+
methods = ['get'] if (methods is None) else methods
130130

131131
def decorator(func):
132132
func.bind_to_methods = methods

0 commit comments

Comments
 (0)