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=inline;hp=-c Patched pagination_tags.py in pagination app to raise Http404 if page doesn't exist. --- 742c7194284dfbe5f051e8c6652d72f00e47f88f 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