Merge "Avoid compare None type using min()"
This commit is contained in:
commit
7ad133195b
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue