Check hash of message when determining if it is a new match

This commit is contained in:
2023-02-02 18:58:40 +00:00
parent 66596cda42
commit 0cbd2d8a6f
2 changed files with 19 additions and 5 deletions

View File

@@ -203,7 +203,8 @@ class NotificationRule(models.Model):
Get the total number of matches for this rule.
"""
if isinstance(self.match, dict):
return f"{sum(list(self.match.values()))}/{len(self.match)}"
truthy_values = [x for x in self.match.values() if x is not False]
return f"{len(truthy_values)}/{len(self.match)}"
def get_notification_settings(self, check=True):
"""