mirror of
https://github.com/django/django.git
synced 2025-10-27 07:36:08 +00:00
Fixed #13689 -- Convert the per_page value to an integer upon initialization of the Paginator class to prevent unpleasant TypeErrors. Thanks, rbanffy, Eric Florenzano and Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16073 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -13,8 +13,8 @@ class EmptyPage(InvalidPage):
|
||||
class Paginator(object):
|
||||
def __init__(self, object_list, per_page, orphans=0, allow_empty_first_page=True):
|
||||
self.object_list = object_list
|
||||
self.per_page = per_page
|
||||
self.orphans = orphans
|
||||
self.per_page = int(per_page)
|
||||
self.orphans = int(orphans)
|
||||
self.allow_empty_first_page = allow_empty_first_page
|
||||
self._num_pages = self._count = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user