Merge "Python 3: Enable sm-api to work after unlock"

This commit is contained in:
Zuul 2021-08-12 12:30:47 +00:00 committed by Gerrit Code Review
commit 46a7ccbb6c
1 changed files with 3 additions and 1 deletions

View File

@ -35,7 +35,9 @@ JSONPATCH_EXCEPTIONS = (jsonpatch.JsonPatchException,
def validate_limit(limit):
if limit and limit < 0:
if limit is None:
return CONF.api_limit_max
elif limit < 0:
raise wsme.exc.ClientSideError(_("Limit must be positive"))
return min(CONF.api_limit_max, limit) or CONF.api_limit_max