diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-06-09 17:55:24 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-06-09 17:55:24 +0200 |
| commit | fc40a6504b78e604a6ba90a3b85b1ed54ee238a2 (patch) | |
| tree | 0cfbd2389dca6b2bd24910cdd315023dfc13586d /django | |
| parent | ef906b163202679413f1fdae7106b8de86477dbe (diff) | |
Fixed #17159 -- Validated returned number of next|previous_page_number
Thanks mehta.apurva at gmail.com for the report and the initial patch
and neaf for the complete patch.
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 8b4d2891b2..6b0b3542f8 100644 --- a/django/core/paginator.py +++ b/django/core/paginator.py @@ -132,10 +132,10 @@ class Page(object): return self.has_previous() or self.has_next() def next_page_number(self): - return self.number + 1 + return self.paginator.validate_number(self.number + 1) def previous_page_number(self): - return self.number - 1 + return self.paginator.validate_number(self.number - 1) def start_index(self): """ |
