mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-11 04:07:39 +03:00
Now throws a 404 if page isn't an int
This commit is contained in:
parent
1eb2dfcc3a
commit
ae059c78da
|
@ -713,7 +713,7 @@ class PaginatorMixin(object):
|
|||
try:
|
||||
page_num = int(self.request.GET.get('page', '1'))
|
||||
except ValueError:
|
||||
page_num = 1
|
||||
raise ErrorResponse(status.HTTP_404_NOT_FOUND, {'detail': 'That page contains no results'})
|
||||
|
||||
if page_num not in paginator.page_range:
|
||||
raise ErrorResponse(status.HTTP_404_NOT_FOUND, {'detail': 'That page contains no results'})
|
||||
|
|
Loading…
Reference in New Issue
Block a user