From d6dc739e87296de75a9a644834e050c13875a894 Mon Sep 17 00:00:00 2001 From: floguy Date: Fri, 11 Jul 2008 08:09:51 +0000 Subject: [PATCH] Fixed bug with extra getvars where an ampersand was always appended. git-svn-id: https://django-pagination.googlecode.com/svn/trunk@16 7f1efe38-554e-0410-b69d-834cb44da2d5 --- pagination/templatetags/pagination_tags.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pagination/templatetags/pagination_tags.py b/pagination/templatetags/pagination_tags.py index 8a88815..66d8640 100644 --- a/pagination/templatetags/pagination_tags.py +++ b/pagination/templatetags/pagination_tags.py @@ -175,7 +175,10 @@ def paginate(context, window=DEFAULT_WINDOW): getvars = context['request'].GET.copy() if 'page' in getvars: del getvars['page'] - to_return['getvars'] = "&%s" % getvars.urlencode() + if len(getvars.keys()) > 0: + to_return['getvars'] = "&%s" % getvars.urlencode() + else: + to_return['getvars'] = '' return to_return except KeyError: return {} -- 2.20.1