diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-05-08 13:53:09 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-06-03 21:43:19 +0800 |
commit | a8219f8be78ad8faaa5ebcc91b5ec30b56b328e9 (patch) | |
tree | bb0ac1bfdafe2b25c7db99d3bc154fb51e0839c5 /apps/patchwork/filters.py | |
parent | 1d46858f7ee46c5f2e052292cf84863b76b06e04 (diff) | |
download | patchwork-a8219f8be78ad8faaa5ebcc91b5ec30b56b328e9.tar.bz2 patchwork-a8219f8be78ad8faaa5ebcc91b5ec30b56b328e9.tar.xz |
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 <jk@ozlabs.org>
Diffstat (limited to 'apps/patchwork/filters.py')
-rw-r--r-- | apps/patchwork/filters.py | 3 |
1 files changed, 2 insertions, 1 deletions
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) |