Skip to content

Commit

Permalink
Guard against LimitOffsetPagination edge case. Closes #3303.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchristie committed Aug 20, 2015
1 parent ed65db3 commit aa4cd7e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rest_framework/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ def get_html_context(self):
_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

Expand Down

0 comments on commit aa4cd7e

Please sign in to comment.