From: Marek Stępniowski Date: Wed, 1 Oct 2008 10:56:38 +0000 (+0200) Subject: Patched pagination_tags.py in pagination app to raise Http404 if page doesn't exist. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/742c7194284dfbe5f051e8c6652d72f00e47f88f?ds=sidebyside;hp=7a9c5008fb186113599c6da6083de7db3ef8708f Patched pagination_tags.py in pagination app to raise Http404 if page doesn't exist. --- diff --git a/apps/pagination/templatetags/pagination_tags.py b/apps/pagination/templatetags/pagination_tags.py index 55e5392fe..4908421ea 100644 --- a/apps/pagination/templatetags/pagination_tags.py +++ b/apps/pagination/templatetags/pagination_tags.py @@ -84,9 +84,11 @@ class AutoPaginateNode(template.Node): try: page_obj = paginator.page(context['request'].page) except InvalidPage: - context[key] = [] - context['invalid_page'] = True - return u'' + # context[key] = [] + # context['invalid_page'] = True + # return u'' + from django.http import Http404 + raise Http404 context[key] = page_obj.object_list context['paginator'] = paginator context['page_obj'] = page_obj