Update pagination.py

simplified divided_with_ceill function
This commit is contained in:
Irakli Butskhrikidze 2020-10-19 18:00:47 +04:00 committed by GitHub
parent 04e0c2b9ab
commit 78741b15f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,10 +35,7 @@ def _divide_with_ceil(a, b):
"""
Returns 'a' divided by 'b', with any remainder rounded up.
"""
if a % b:
return (a // b) + 1
return a // b
return (a + b - 1) // b
def _get_displayed_page_numbers(current, final):