Patched pagination_tags.py in pagination app to raise Http404 if page doesn't exist.
[wolnelektury.git] / 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