Skip to content

Commit

Permalink
[#4801] Use ints in paginator
Browse files Browse the repository at this point in the history
Otherwise we get the following in py3:

TypeError: 'float' object cannot be interpreted as an integer
  • Loading branch information
amercader committed Dec 20, 2019
1 parent a44af3e commit cb9b03e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckan/lib/pagination.py
Expand Up @@ -176,7 +176,8 @@ def __init__(
# Compute the number of the first and last available page
if self.item_count > 0:
self.first_page = 1
self.page_count = ((self.item_count - 1) / self.items_per_page) + 1
self.page_count = int(
((self.item_count - 1) / self.items_per_page) + 1)
self.last_page = self.first_page + self.page_count - 1

# Make sure that the requested page number is the range of
Expand Down

0 comments on commit cb9b03e

Please sign in to comment.