diff --git a/engine/apps/alerts/tasks/notify_user.py b/engine/apps/alerts/tasks/notify_user.py index c40cb4900b..e9c2437640 100644 --- a/engine/apps/alerts/tasks/notify_user.py +++ b/engine/apps/alerts/tasks/notify_user.py @@ -230,8 +230,18 @@ def perform_notification(log_record_pk): from apps.base.models import UserNotificationPolicy, UserNotificationPolicyLogRecord from apps.telegram.models import TelegramToUserConnector + # TODO: remove this log line once done investigation + task_logger.info(f"perform_notification: log_record {log_record_pk}") + log_record = UserNotificationPolicyLogRecord.objects.get(pk=log_record_pk) + # TODO: uncomment this out once done investigation + # try: + # log_record = UserNotificationPolicyLogRecord.objects.get(pk=log_record_pk) + # except UserNotificationPolicyLogRecord.DoesNotExist: + # task_logger.info(f"perform_notification: log_record {log_record_pk} doesn't exist. Skipping remainder of task") + # return + user = log_record.author alert_group = log_record.alert_group notification_policy = log_record.notification_policy