Properly search tokens and annotate in matched field
This commit is contained in:
@@ -234,6 +234,16 @@ class NotificationRuleData(object):
|
||||
break
|
||||
# Continue to next field
|
||||
continue
|
||||
if field == "tokens":
|
||||
# Allow partial matches for tokens
|
||||
for token in value:
|
||||
if "tokens" in message:
|
||||
if token.lower() in [x.lower() for x in message["tokens"]]:
|
||||
matched[field] = token
|
||||
# Break out of the token matching loop
|
||||
break
|
||||
# Continue to next field
|
||||
continue
|
||||
if field in message and message[field] in value:
|
||||
# Do exact matches for all other fields
|
||||
matched[field] = message[field]
|
||||
|
||||
Reference in New Issue
Block a user