mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixes Paginator.validate_number not raising a PageNotAnInteger exception when passed a non-int-castable type.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16026 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -22,7 +22,7 @@ class Paginator(object):
|
||||
"Validates the given 1-based page number."
|
||||
try:
|
||||
number = int(number)
|
||||
except ValueError:
|
||||
except (TypeError, ValueError):
|
||||
raise PageNotAnInteger('That page number is not an integer')
|
||||
if number < 1:
|
||||
raise EmptyPage('That page number is less than 1')
|
||||
|
||||
Reference in New Issue
Block a user