mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Clamp limit=0 to default_limit
This commit is contained in:
parent
c3d38ea9c1
commit
af2768aa3d
@ -45,7 +45,7 @@ class OptionalLimitOffsetPagination(LimitOffsetPagination):
|
|||||||
# Enforce maximum page size, if defined
|
# Enforce maximum page size, if defined
|
||||||
MAX_PAGE_SIZE = get_config().MAX_PAGE_SIZE
|
MAX_PAGE_SIZE = get_config().MAX_PAGE_SIZE
|
||||||
if MAX_PAGE_SIZE:
|
if MAX_PAGE_SIZE:
|
||||||
return MAX_PAGE_SIZE if limit == 0 else min(limit, MAX_PAGE_SIZE)
|
return min(self.default_limit, MAX_PAGE_SIZE) if limit == 0 else min(limit, MAX_PAGE_SIZE)
|
||||||
return limit
|
return limit
|
||||||
except (KeyError, ValueError):
|
except (KeyError, ValueError):
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user