Prepopulate the match field

master
Mark Veidemanis 1 year ago
parent ddffc2c3d8
commit 742a2f92da
Signed by: m
GPG Key ID: 5ACFCEED46C0904F

@ -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):
"""

Loading…
Cancel
Save