|
|
|
@ -214,6 +214,15 @@ class NotificationRule(models.Model):
|
|
|
|
|
raise ValueError(f"Invalid YAML: {e}")
|
|
|
|
|
return parsed
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def matches(self):
|
|
|
|
|
"""
|
|
|
|
|
Get the total number of matches for this rule.
|
|
|
|
|
"""
|
|
|
|
|
if isinstance(self.match, dict):
|
|
|
|
|
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):
|
|
|
|
|
"""
|
|
|
|
|
Get the notification settings for this rule.
|
|
|
|
|