Merge "Avoid compare None type using min()"

This commit is contained in:
Jenkins 2016-03-01 01:50:48 +00:00 committed by Gerrit Code Review
commit 7ad133195b
1 changed files with 4 additions and 1 deletions

View File

@ -35,7 +35,10 @@ def validate_limit(limit):
if limit is not None and limit <= 0:
raise wsme.exc.ClientSideError(_("Limit must be positive"))
return min(CONF.api.max_limit, limit) or CONF.api.max_limit
if limit is not None:
return min(CONF.api.max_limit, limit)
else:
return CONF.api.max_limit
def validate_sort_dir(sort_dir):