From e09c307d58e14ed208031b193930109c97726d8c Mon Sep 17 00:00:00 2001 From: sadnub Date: Fri, 15 Apr 2022 17:42:45 -0400 Subject: [PATCH] fix tests --- api/tacticalrmm/checks/models.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/api/tacticalrmm/checks/models.py b/api/tacticalrmm/checks/models.py index bfed734f..1b4a3d44 100644 --- a/api/tacticalrmm/checks/models.py +++ b/api/tacticalrmm/checks/models.py @@ -402,6 +402,22 @@ class CheckResult(models.Model): def __str__(self): return f"{self.agent.hostname} - {self.assigned_check}" + def save(self, *args, **kwargs): + + # if check is a policy check clear cache on everything + if not self.alert_severity and self.assigned_check.check_type in [ + "cpuload", + "memory", + "diskspace", + "script", + ]: + self.alert_severity = "warning" + + super(CheckResult, self).save( + *args, + **kwargs, + ) + @property def history_info(self): if (