From ac41f90217fb7a3d36d405dbc77554aea7a6b15b Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sat, 3 Jan 2015 23:53:55 +0100 Subject: [PATCH] TaskFilter: Implement workaround around TW-1479 --- tasklib/task.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tasklib/task.py b/tasklib/task.py index b1af4f7..7d1bbe4 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -433,9 +433,15 @@ class TaskFilter(SerializingObject): if key == 'uuid': self.filter_params.insert(0, value) else: - # We enforce equality match by using is keyword - # Also, without using this syntax, filter fails due to TW-1479 - self.filter_params.append("{0}.is:'{1}'".format(key, value)) + # Surround value with aphostrophes unless it's a empty string + value = "'%s'" % value if value else '' + + # We enforce equality match by using 'is' (or 'none') modifier + # Without using this syntax, filter fails due to TW-1479 + modifier = '.is' if value else '.none' + key = key + modifier if '.' not in key else key + + self.filter_params.append("{0}:{1}".format(key, value)) def get_filter_params(self): return [f for f in self.filter_params if f] -- 2.39.5