From a8219f8be78ad8faaa5ebcc91b5ec30b56b328e9 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Thu, 8 May 2014 13:53:09 +0800 Subject: [PATCH] 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 --- apps/patchwork/filters.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.39.2