From 2113aad5751b9ebefc89d4880865a40d3665d9c4 Mon Sep 17 00:00:00 2001 From: Ygal Nezri <155719988+Ygal13000@users.noreply.github.com> Date: Thu, 27 Jun 2024 09:33:40 +0200 Subject: [PATCH] Fix false positives in domain monitoring module Corrected the issue causing false positives in the domain monitoring module. --- Watcher/Watcher/site_monitoring/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Watcher/Watcher/site_monitoring/core.py b/Watcher/Watcher/site_monitoring/core.py index a5706ba..553021d 100644 --- a/Watcher/Watcher/site_monitoring/core.py +++ b/Watcher/Watcher/site_monitoring/core.py @@ -367,7 +367,7 @@ def create_alert(alert, site, new_ip, new_ip_second, score): last_two_alerts = Alert.objects.filter(site=site, created_at__gte=one_hour_ago, created_at__lte=now).order_by('-created_at')[:2] # Check if the new alert is identical to the last two alerts created at the exact same time - for previous_alert in last_two_alerts: + for previous_alert in last_two_alerts: if all(getattr(previous_alert, key) == value for key, value in alert_data.items()) and previous_alert.created_at == now: return @@ -450,4 +450,4 @@ def send_email(message, rtir, alert_id): for email in emails_to: print(str(timezone.now()) + " - Email sent to ", email) else: - print(str(timezone.now()) + " - No subscriber, no email sent.") \ No newline at end of file + print(str(timezone.now()) + " - No subscriber, no email sent.")