From: NeilBrown Date: Fri, 20 Dec 2013 00:02:38 +0000 (+1100) Subject: profile: fix multi-cond rule matching. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=b7028c6447f53013a962ef86b59308f99e9706e6;p=plato.git profile: fix multi-cond rule matching. --- diff --git a/lib/profile.py b/lib/profile.py index 42780fe..3f77bb9 100644 --- a/lib/profile.py +++ b/lib/profile.py @@ -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