]> git.droids-corp.org - imapami.git/commitdiff
conditions: fix criteria for 'or'
authorOlivier Matz <zer0@platinum>
Wed, 25 Nov 2015 17:54:18 +0000 (18:54 +0100)
committerOlivier Matz <zer0@platinum>
Wed, 25 Nov 2015 17:54:18 +0000 (18:54 +0100)
The criteria was wrongly set to None as the following code has
no return value:
  criteria = set().add(criteria)

We should do this instead:
  criteria = set([criteria])

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
imapami/conditions.py

index 57014d9e0247ca091e7ed3d17f7a1450c761669e..4d06e88209e1aff40676a6cc6b3ac3a292a88af2 100644 (file)
@@ -676,7 +676,7 @@ class ImapamiCondOr(ImapamiCond):
             else:
                 criteria = 'OR (%s) (%s)' % (criteria, crit)
         if criteria != '':
-            criteria = set().add(criteria)
+            criteria = set([criteria])
         fetch = imapami.utils.highest_fetch_level(
             [c.fetch for c in cond_list])
         ImapamiCond.__init__(self, fetch=fetch, criteria=criteria)