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.")