Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinitialize surge notifications #2202

Merged
merged 1 commit into from
Aug 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions api/management/commands/index_and_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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():
Expand All @@ -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():
Expand Down