From 951cf70f69e9ec7f60db366f90477fe0eefb0be5 Mon Sep 17 00:00:00 2001 From: Justin Quick Date: Tue, 20 Jul 2010 14:57:11 -0400 Subject: [PATCH] add request back from context and fix error handling --- pagination/templatetags/pagination_tags.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pagination/templatetags/pagination_tags.py b/pagination/templatetags/pagination_tags.py index ae843b1..dd338a2 100644 --- a/pagination/templatetags/pagination_tags.py +++ b/pagination/templatetags/pagination_tags.py @@ -214,6 +214,7 @@ def paginate(context, window=DEFAULT_WINDOW, hashtag=''): 'is_paginated': paginator.count > paginator.per_page, } if 'request' in context: + to_return['request'] = context['request'] getvars = context['request'].GET.copy() if 'page' in getvars: del getvars['page'] @@ -222,7 +223,7 @@ def paginate(context, window=DEFAULT_WINDOW, hashtag=''): else: to_return['getvars'] = '' return to_return - except KeyError, AttributeError: + except (KeyError, AttributeError): return {} register.inclusion_tag('pagination/pagination.html', takes_context=True)( -- 2.20.1