LimitOffsetPagination zero final page fix, closes #3303

This commit is contained in:
Uğur Ünver 2015-08-20 02:04:01 +03:00
parent ed65db367a
commit 8c280d0c42

View File

@ -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