diff options
| author | Jannis Leidel <jannis@leidel.info> | 2011-04-22 12:03:03 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2011-04-22 12:03:03 +0000 |
| commit | 0e9692bc66ed7cfbbcb4c8031b36e82751685238 (patch) | |
| tree | 4e2b52e40f3d3ead84857facdb2a78187e86a184 /django | |
| parent | e744fec8f9c47c8d45045d36df202deb4b6c3b9f (diff) | |
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
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/paginator.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/paginator.py b/django/core/paginator.py index 3cec491905..bd8757c708 100644 --- a/django/core/paginator.py +++ b/django/core/paginator.py @@ -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 |
