Patched pagination_tags.py in pagination app to raise Http404 if page doesn't exist.
authorMarek Stępniowski <marek@stepniowski.com>
Wed, 1 Oct 2008 10:56:38 +0000 (12:56 +0200)
committerMarek Stępniowski <marek@stepniowski.com>
Wed, 1 Oct 2008 10:56:38 +0000 (12:56 +0200)
apps/pagination/templatetags/pagination_tags.py

index 55e5392..4908421 100644 (file)
@@ -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