From: floguy Date: Fri, 11 Jul 2008 08:09:51 +0000 (+0000) Subject: Fixed bug with extra getvars where an ampersand was always appended. X-Git-Tag: 1.0.6~41 X-Git-Url: https://git.mdrn.pl/django-pagination.git/commitdiff_plain/d6dc739e87296de75a9a644834e050c13875a894 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 --- 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 {}