Guard against LimitOffsetPagination edge case. Closes #3303.

This commit is contained in:
Tom Christie 2015-08-20 10:12:52 +01:00
parent ed65db367a
commit aa4cd7e9d7

View File

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