]> git.neil.brown.name Git - plato.git/commitdiff
profile: fix multi-cond rule matching.
authorNeilBrown <neilb@suse.de>
Fri, 20 Dec 2013 00:02:38 +0000 (11:02 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 20 Dec 2013 00:02:38 +0000 (11:02 +1100)
lib/profile.py

index 42780fe024fc8900b83173117854bea72aa63095..3f77bb9001a672c6d9167a563d4ac634985e8273 100644 (file)
@@ -85,9 +85,12 @@ def rule_matches(rule, event, who, when):
                 continue
             return False
 
+        c = False
         for w in who.split(' '):
             if w[-8:] == r[-8:]:
-                continue
+                c = True
+        if c:
+            continue
 
         tm = time.localtime()
         a = day_match(r, tm)
@@ -98,6 +101,9 @@ def rule_matches(rule, event, who, when):
         a = time_match(r, tm)
         if a == False:
             return False
+        if a == True:
+            continue
+        return False
 
     return True