]> git.ozlabs.org Git - patchwork/commitdiff
filters: fix exception in filter querystring generation
authorJeremy Kerr <jk@ozlabs.org>
Thu, 8 May 2014 05:53:09 +0000 (13:53 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 3 Jun 2014 13:43:19 +0000 (21:43 +0800)
We get a silent (as it's during template render) exception when
generating filter querystrings, as we're passing a list to the string
format operator rather than a tuple.

This change removes the map and explicitly applies sanitise to the
(name, value) pair.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/filters.py

index 002a0a855b491c93240eb23e77d404116e37406e..8323fe86a0fe5549701646b5bbda75ee5cf82f74 100644 (file)
@@ -452,7 +452,8 @@ class Filters:
                 s = unicode(s)
             return quote(s.encode('utf-8'))
 
-        return '?' + '&'.join(['%s=%s' % map(sanitise, p) for p in pairs])
+        return '?' + '&'.join(['%s=%s' % (sanitise(k), sanitise(v))
+                                    for (k, v) in pairs])
 
     def querystring_without_filter(self, filter):
         return self.querystring(filter)