From ccf703e4bc42a564d2bae938676e327b9fa6fb27 Mon Sep 17 00:00:00 2001 From: jokob-sk <96159884+jokob-sk@users.noreply.github.com> Date: Fri, 18 Feb 2022 00:26:00 +0000 Subject: [PATCH] Fixing reporting on disabled MAC addresses --- back/pialert.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/back/pialert.py b/back/pialert.py index 1a1e5da7..52367a4f 100644 --- a/back/pialert.py +++ b/back/pialert.py @@ -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()