Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Parens around if clause
  • Loading branch information
longhotsummer committed Feb 4, 2015
commit e13d2af1374c8a2b2146e1126d9406bfb4bbd9ec
6 changes: 3 additions & 3 deletions rest_framework/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def api_view(http_method_names=None):
Decorator that converts a function-based view into an APIView subclass.
Takes a list of allowed methods for the view as an argument.
"""
http_method_names = ['GET'] if http_method_names is None else http_method_names
http_method_names = ['GET'] if (http_method_names is None) else http_method_names

def decorator(func):

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

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

def decorator(func):
func.bind_to_methods = methods
Expand Down