Skip to content

Commit 3f5ca05

Browse files
author
Simon Willison
committed
Don't link to ?tag=javascript&tag=javascript...
Thanks @r4vi b8484c5#commitcomment-24703995
1 parent 3955f41 commit 3f5ca05

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

blog/templatetags/blog_tags.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ def page_href(context, page):
5454
@register.simple_tag(takes_context=True)
5555
def add_qsarg(context, name, value):
5656
query_dict = context['request'].GET.copy()
57-
query_dict.appendlist(name, value)
57+
if value not in query_dict.getlist(name):
58+
query_dict.appendlist(name, value)
5859
return '?' + query_dict.urlencode()
5960

6061

0 commit comments

Comments
 (0)