From: Jeremy Kerr Date: Thu, 8 May 2014 05:53:09 +0000 (+0800) Subject: filters: fix exception in filter querystring generation X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=a8219f8be78ad8faaa5ebcc91b5ec30b56b328e9;p=patchwork filters: fix exception in filter querystring generation 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 --- diff --git a/apps/patchwork/filters.py b/apps/patchwork/filters.py index 002a0a8..8323fe8 100644 --- a/apps/patchwork/filters.py +++ b/apps/patchwork/filters.py @@ -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)