]> git.droids-corp.org - imapami.git/commitdiff
conditions: fix criteria for 'not'
authorOlivier Matz <zer0@platinum>
Wed, 25 Nov 2015 17:53:24 +0000 (18:53 +0100)
committerOlivier Matz <zer0@platinum>
Wed, 25 Nov 2015 17:53:24 +0000 (18:53 +0100)
Only the check was inverted, but the criteria should be too.

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

index 97675a7e045849da45c217b83a99a6305904888e..57014d9e0247ca091e7ed3d17f7a1450c761669e 100644 (file)
@@ -128,7 +128,8 @@ class ImapamiCondNot(ImapamiCond):
     name = "not"
     def __init__(self, cond):
         cond = new(cond)
-        ImapamiCond.__init__(self, fetch=cond.fetch, criteria=cond.criteria)
+        criteria = 'NOT (%s)' % (cond.get_criteria())
+        ImapamiCond.__init__(self, fetch=cond.fetch, criteria=criteria)
         self.cond = cond
 
     def check(self, ami, mail):