backoffice: use integer division for pagination (#36515)

This commit is contained in:
Frédéric Péters 2019-11-12 19:29:51 +01:00
parent 5f1629a898
commit cf248b9e5a
1 changed files with 3 additions and 3 deletions

View File

@ -39,9 +39,9 @@ def pagination_links(offset, limit, total_count):
# display links to individual pages
page_range = 7
current_page = offset / limit + 1
last_page = max((total_count-1) / limit + 1, 1)
start = max(current_page - (page_range / 2), 1)
current_page = offset // limit + 1
last_page = max((total_count-1) // limit + 1, 1)
start = max(current_page - (page_range // 2), 1)
end = min(start + page_range - 1, last_page)
page_numbers = list(range(start, end + 1))
if not page_numbers: