Prepopulate the match field

This commit is contained in:
Mark Veidemanis 2023-01-16 00:29:54 +00:00
parent ddffc2c3d8
commit 742a2f92da
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 10 additions and 0 deletions

View File

@ -136,6 +136,16 @@ class NotificationRuleData(object):
self.validate_permissions() self.validate_permissions()
self.validate_schedule_fields() self.validate_schedule_fields()
self.validate_time_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): def store_match(self, index, match):
""" """