diff --git a/api/tacticalrmm/alerts/models.py b/api/tacticalrmm/alerts/models.py index 278af079aa..a9c6f74d45 100644 --- a/api/tacticalrmm/alerts/models.py +++ b/api/tacticalrmm/alerts/models.py @@ -118,6 +118,9 @@ def resolve(self) -> None: def create_or_return_availability_alert( cls, agent: Agent, skip_create: bool = False ) -> Optional[Alert]: + if agent.maintenance_mode: + return None + if not cls.objects.filter( agent=agent, alert_type=AlertType.AVAILABILITY, resolved=False ).exists(): @@ -166,6 +169,9 @@ def create_or_return_check_alert( alert_severity: Optional[str] = None, skip_create: bool = False, ) -> "Optional[Alert]": + if agent.maintenance_mode: + return None + # need to pass agent if the check is a policy if not cls.objects.filter( assigned_check=check, @@ -230,6 +236,9 @@ def create_or_return_task_alert( agent: "Agent", skip_create: bool = False, ) -> "Optional[Alert]": + if agent.maintenance_mode: + return None + if not cls.objects.filter( assigned_task=task, agent=agent,