From 673481c47833c032b5dc0db359ba52c33f041132 Mon Sep 17 00:00:00 2001 From: Szabo Zoltan Date: Thu, 4 Jul 2024 12:06:18 +0200 Subject: [PATCH] Reinitialize surge notifications --- api/management/commands/index_and_notify.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/management/commands/index_and_notify.py b/api/management/commands/index_and_notify.py index 246d9199c..bc4020dc7 100644 --- a/api/management/commands/index_and_notify.py +++ b/api/management/commands/index_and_notify.py @@ -25,7 +25,7 @@ from deployments.models import ERU, Personnel, PersonnelDeployment from main.sentry import SentryMonitor from notifications.hello import get_hello -from notifications.models import RecordType, Subscription, SubscriptionType +from notifications.models import RecordType, Subscription, SubscriptionType, SurgeAlert from notifications.notification import send_notification from utils.elasticsearch import construct_es_data @@ -955,8 +955,8 @@ def handle(self, *args, **options): diff=ExpressionWrapper(F("updated_at") - F("created_at"), output_field=DurationField()) ).filter(condU & cond2 & Q(diff__gt=timedelta(minutes=1))) - # new_surgealerts = SurgeAlert.objects.filter(cond1) - # new_pers_deployments = PersonnelDeployment.objects.filter(cond1) + new_surgealerts = SurgeAlert.objects.filter(cond1) + new_pers_deployments = PersonnelDeployment.objects.filter(cond1) # Merge Weekly Digest into one mail instead of separate ones if self.is_digest_mode(): @@ -968,8 +968,8 @@ def handle(self, *args, **options): # self.notify(updated_appeals, RecordType.APPEAL, SubscriptionType.EDIT) self.notify(new_events, RecordType.EVENT, SubscriptionType.NEW) # self.notify(updated_events, RecordType.EVENT, SubscriptionType.EDIT) - # temporary switched off while historical data is uploaded: self.notify(new_surgealerts, RecordType.SURGE_ALERT, SubscriptionType.NEW) # noqa: E501 - # temporary switched off while historical data is uploaded: self.notify(new_pers_deployments, RecordType.SURGE_DEPLOYMENT_MESSAGES, SubscriptionType.NEW) # noqa: E501 + self.notify(new_surgealerts, RecordType.SURGE_ALERT, SubscriptionType.NEW) + self.notify(new_pers_deployments, RecordType.SURGE_DEPLOYMENT_MESSAGES, SubscriptionType.NEW) # Followed Events if self.is_daily_checkup_time():