mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-29 17:39:48 +03:00
Fix #7575
Take max_limit into account when no limit parameter is present in the request with LimitOffsetPagination class. If max_limit is less than default limit then max_limit will be returned.
This commit is contained in:
parent
8812394ed8
commit
eea623e0d2
|
@ -439,6 +439,12 @@ class LimitOffsetPagination(BasePagination):
|
||||||
except (KeyError, ValueError):
|
except (KeyError, ValueError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
return self.get_lower_of_max_or_default_limit()
|
||||||
|
|
||||||
|
def get_lower_of_max_or_default_limit(self):
|
||||||
|
try:
|
||||||
|
return min(self.max_limit, self.default_limit)
|
||||||
|
except TypeError:
|
||||||
return self.default_limit
|
return self.default_limit
|
||||||
|
|
||||||
def get_offset(self, request):
|
def get_offset(self, request):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user