diff --git a/engine/apps/alerts/escalation_snapshot/escalation_snapshot_mixin.py b/engine/apps/alerts/escalation_snapshot/escalation_snapshot_mixin.py index e846a83d..afccd39c 100644 --- a/engine/apps/alerts/escalation_snapshot/escalation_snapshot_mixin.py +++ b/engine/apps/alerts/escalation_snapshot/escalation_snapshot_mixin.py @@ -20,6 +20,7 @@ if typing.TYPE_CHECKING: from apps.alerts.models import ChannelFilter logger = logging.getLogger(__name__) +logger.setLevel(logging.DEBUG) # Is a delay to prevent intermediate activity by system in case user is doing some multi-step action. # For example if user wants to unack and ack we don't need to launch escalation right after unack. @@ -228,15 +229,17 @@ class EscalationSnapshotMixin: """ from apps.alerts.models import AlertGroup - is_on_maintenace_or_debug_mode = self.channel.maintenance_mode is not None + is_on_maintenance_or_debug_mode = self.channel.maintenance_mode is not None - if self.is_restricted or is_on_maintenace_or_debug_mode or not self.escalation_chain_exists: + if self.is_restricted or is_on_maintenance_or_debug_mode or not self.escalation_chain_exists: logger.debug( f"Not escalating alert group w/ pk: {self.pk}\n" f"is_restricted: {self.is_restricted}\n" - f"is_on_maintenace_or_debug_mode: {is_on_maintenace_or_debug_mode}\n" + f"is_on_maintenance_or_debug_mode: {is_on_maintenance_or_debug_mode}\n" f"escalation_chain_exists: {self.escalation_chain_exists}" ) + # set is_escalation_finished to True as this alert group won't be escalated + AlertGroup.objects.filter(pk=self.pk).update(is_escalation_finished=True) return logger.debug(f"Start escalation for alert group with pk: {self.pk}")