diff --git a/engine/apps/alerts/models/alert_receive_channel.py b/engine/apps/alerts/models/alert_receive_channel.py index 2c45c68d..100b5b7b 100644 --- a/engine/apps/alerts/models/alert_receive_channel.py +++ b/engine/apps/alerts/models/alert_receive_channel.py @@ -422,6 +422,8 @@ class AlertReceiveChannel(IntegrationOptionsMixin, MaintainableObject): @property def new_incidents_web_link(self): + from apps.alerts.models import AlertGroup + return UIURLBuilder(self.organization).alert_groups( f"?integration={self.public_primary_key}&status={AlertGroup.NEW}", ) diff --git a/engine/apps/alerts/tasks/notify_user.py b/engine/apps/alerts/tasks/notify_user.py index 53b88129..7ad2bb49 100644 --- a/engine/apps/alerts/tasks/notify_user.py +++ b/engine/apps/alerts/tasks/notify_user.py @@ -400,7 +400,7 @@ def perform_notification(log_record_pk, use_default_notification_policy_fallback UserNotificationPolicyLogRecord( author=user, type=UserNotificationPolicyLogRecord.TYPE_PERSONAL_NOTIFICATION_FAILED, - notification_policy=notification_policy, + notification_policy=notification_policy if not use_default_notification_policy_fallback else None, reason="Expected data is missing", alert_group=alert_group, notification_step=notification_policy.step if notification_policy else None, @@ -424,7 +424,7 @@ def perform_notification(log_record_pk, use_default_notification_policy_fallback UserNotificationPolicyLogRecord( author=user, type=UserNotificationPolicyLogRecord.TYPE_PERSONAL_NOTIFICATION_FAILED, - notification_policy=notification_policy, + notification_policy=notification_policy if not use_default_notification_policy_fallback else None, reason="Skipped notification because alert group is resolved", alert_group=alert_group, notification_step=notification_policy.step if notification_policy else None,