Revert "Now throws a 404 if page isn't an int"

This reverts commit ae059c78da.
This commit is contained in:
Tom Christie 2011-07-19 20:39:15 +01:00
parent 8136a94ebe
commit 20a95db60a

View File

@ -713,7 +713,7 @@ class PaginatorMixin(object):
try:
page_num = int(self.request.GET.get('page', '1'))
except ValueError:
raise ErrorResponse(status.HTTP_404_NOT_FOUND, {'detail': 'That page contains no results'})
page_num = 1
if page_num not in paginator.page_range:
raise ErrorResponse(status.HTTP_404_NOT_FOUND, {'detail': 'That page contains no results'})