forked from github/pelican
Removed a division by zero
This commit is contained in:
parent
dfb214d47d
commit
b909e4aac3
1 changed files with 1 additions and 1 deletions
|
|
@ -27,7 +27,7 @@ class Paginator(object):
|
|||
"Returns the total number of pages."
|
||||
if self._num_pages is None:
|
||||
hits = max(1, self.count - self.orphans)
|
||||
self._num_pages = int(ceil(hits / float(self.per_page)))
|
||||
self._num_pages = int(ceil(hits / (float(self.per_page) or 1)))
|
||||
return self._num_pages
|
||||
num_pages = property(_get_num_pages)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue