Fixed #1. Thanks, Martin Mahner and Jannis Leidel.
authorfloguy <floguy@7f1efe38-554e-0410-b69d-834cb44da2d5>
Sun, 13 Jul 2008 22:15:50 +0000 (22:15 +0000)
committerfloguy <floguy@7f1efe38-554e-0410-b69d-834cb44da2d5>
Sun, 13 Jul 2008 22:15:50 +0000 (22:15 +0000)
git-svn-id: https://django-pagination.googlecode.com/svn/trunk@21 7f1efe38-554e-0410-b69d-834cb44da2d5

CONTRIBUTORS.txt
pagination/middleware.py
pagination/templatetags/pagination_tags.py

index 53288df..ce3e326 100644 (file)
@@ -1 +1,3 @@
-Eric Florenzano <floguy@gmail.com>
\ No newline at end of file
+Eric Florenzano <floguy@gmail.com>
+Martin Mahner <martin@mahner.org>
+James Tauber <jtauber@gmail.com>
\ No newline at end of file
index dd69377..b99a7e3 100644 (file)
@@ -6,5 +6,5 @@ class PaginationMiddleware(object):
     def process_request(self, request):
         try:
             request.page = int(request['page'])
     def process_request(self, request):
         try:
             request.page = int(request['page'])
-        except KeyError:
+        except (KeyError, ValueError):
             request.page = 1
\ No newline at end of file
             request.page = 1
\ No newline at end of file
index 66d8640..ab00df7 100644 (file)
@@ -71,7 +71,9 @@ class AutoPaginateNode(template.Node):
         paginator = paginator_class(value, self.paginate_by)
         try:
             page_obj = paginator.page(context['request'].page)
         paginator = paginator_class(value, self.paginate_by)
         try:
             page_obj = paginator.page(context['request'].page)
-        except:
+        except InvalidPage:
+            context[key] = []
+            context['invalid_page'] = True
             return u''
         context[key] = page_obj.object_list
         context['paginator'] = paginator
             return u''
         context[key] = page_obj.object_list
         context['paginator'] = paginator