mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-08 14:24:48 +03:00
LimitOffsetPagination zero final page fix, closes #3303
This commit is contained in:
parent
ed65db367a
commit
8c280d0c42
|
@ -423,6 +423,11 @@ class LimitOffsetPagination(BasePagination):
|
|||
_divide_with_ceil(self.count - self.offset, self.limit) +
|
||||
_divide_with_ceil(self.offset, self.limit)
|
||||
)
|
||||
|
||||
# Final page must be at least first page
|
||||
if not final:
|
||||
final = 1
|
||||
|
||||
if current > final:
|
||||
current = final
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user