backoffice: use integer division for pagination (#36515)
This commit is contained in:
parent
5f1629a898
commit
cf248b9e5a
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue