1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #19240 -- include pagination error details in ListView 404

Thanks to seawolf for the patch
This commit is contained in:
Preston Holmes
2012-11-04 15:46:30 -08:00
parent 0a49e6164c
commit 5a00a57aa5
2 changed files with 15 additions and 4 deletions

View File

@@ -50,9 +50,10 @@ class MultipleObjectMixin(ContextMixin):
try:
page = paginator.page(page_number)
return (paginator, page, page.object_list, page.has_other_pages())
except InvalidPage:
raise Http404(_('Invalid page (%(page_number)s)') % {
'page_number': page_number
except InvalidPage as e:
raise Http404(_('Invalid page (%(page_number)s): %(message)s') % {
'page_number': page_number,
'message': e.message,
})
def get_paginate_by(self, queryset):