mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
Guard against LimitOffsetPagination edge case. Closes #3303.
This commit is contained in:
parent
ed65db367a
commit
aa4cd7e9d7
|
@ -423,6 +423,9 @@ class LimitOffsetPagination(BasePagination):
|
|||
_divide_with_ceil(self.count - self.offset, self.limit) +
|
||||
_divide_with_ceil(self.offset, self.limit)
|
||||
)
|
||||
if final < 1:
|
||||
final = 1
|
||||
|
||||
if current > final:
|
||||
current = final
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user