Fixing reporting on disabled MAC addresses

This commit is contained in:
jokob-sk
2022-02-18 00:26:00 +00:00
committed by GitHub
parent bbe3a3bb15
commit ccf703e4bc

View File

@@ -1167,6 +1167,13 @@ def email_reporting ():
print ('\nReporting...')
openDB()
# Disable reporting on events for devices where reporting is disabled based on the MAC address
sql.execute ("""UPDATE Events SET eve_PendingAlertEmail = 0
WHERE eve_PendingAlertEmail = 1 AND eve_MAC IN
(
SELECT dev_MAC FROM Devices WHERE dev_AlertEvents = 0
)""")
# Open text Template
template_file = open(PIALERT_BACK_PATH + '/report_template.txt', 'r')
mail_text = template_file.read()