Skip to content

Commit f062f8c

Browse files
committed
Reinitialize surge notifications
1 parent 1b3b153 commit f062f8c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

api/management/commands/index_and_notify.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from deployments.models import ERU, Personnel, PersonnelDeployment
2626
from main.sentry import SentryMonitor
2727
from notifications.hello import get_hello
28-
from notifications.models import RecordType, Subscription, SubscriptionType
28+
from notifications.models import RecordType, Subscription, SubscriptionType, SurgeAlert
2929
from notifications.notification import send_notification
3030
from utils.elasticsearch import construct_es_data
3131

@@ -955,8 +955,8 @@ def handle(self, *args, **options):
955955
diff=ExpressionWrapper(F("updated_at") - F("created_at"), output_field=DurationField())
956956
).filter(condU & cond2 & Q(diff__gt=timedelta(minutes=1)))
957957

958-
# new_surgealerts = SurgeAlert.objects.filter(cond1)
959-
# new_pers_deployments = PersonnelDeployment.objects.filter(cond1)
958+
new_surgealerts = SurgeAlert.objects.filter(cond1)
959+
new_pers_deployments = PersonnelDeployment.objects.filter(cond1)
960960

961961
# Merge Weekly Digest into one mail instead of separate ones
962962
if self.is_digest_mode():
@@ -968,8 +968,8 @@ def handle(self, *args, **options):
968968
# self.notify(updated_appeals, RecordType.APPEAL, SubscriptionType.EDIT)
969969
self.notify(new_events, RecordType.EVENT, SubscriptionType.NEW)
970970
# self.notify(updated_events, RecordType.EVENT, SubscriptionType.EDIT)
971-
# temporary switched off while historical data is uploaded: self.notify(new_surgealerts, RecordType.SURGE_ALERT, SubscriptionType.NEW) # noqa: E501
972-
# temporary switched off while historical data is uploaded: self.notify(new_pers_deployments, RecordType.SURGE_DEPLOYMENT_MESSAGES, SubscriptionType.NEW) # noqa: E501
971+
self.notify(new_surgealerts, RecordType.SURGE_ALERT, SubscriptionType.NEW)
972+
self.notify(new_pers_deployments, RecordType.SURGE_DEPLOYMENT_MESSAGES, SubscriptionType.NEW)
973973

974974
# Followed Events
975975
if self.is_daily_checkup_time():

0 commit comments

Comments
 (0)