From 742a2f92da9af01f836103a3715e881f0d3a4f24 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 16 Jan 2023 00:29:54 +0000 Subject: [PATCH] Prepopulate the match field --- core/lib/rules.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/lib/rules.py b/core/lib/rules.py index 6fb9309..5518817 100644 --- a/core/lib/rules.py +++ b/core/lib/rules.py @@ -136,6 +136,16 @@ class NotificationRuleData(object): self.validate_permissions() self.validate_schedule_fields() self.validate_time_fields() + if self.object is not None: + self.populate_matched() + + def populate_matched(self): + if self.object.match is None: + self.object.match = {} + for index in self.parsed["index"]: + if index not in self.object.match: + self.object.match[index] = False + self.object.save() def store_match(self, index, match): """