From: Justin Quick Date: Tue, 20 Jul 2010 18:57:11 +0000 (-0400) Subject: add request back from context and fix error handling X-Git-Tag: release-2.0~9^2~2 X-Git-Url: https://git.mdrn.pl/django-pagination.git/commitdiff_plain/951cf70f69e9ec7f60db366f90477fe0eefb0be5?hp=--cc add request back from context and fix error handling --- 951cf70f69e9ec7f60db366f90477fe0eefb0be5 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)(