From 4e6231ab19c69d3b8799ecea0345850ba017ff05 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Tue, 16 Jul 2024 19:22:06 +0800 Subject: [PATCH] perf: Notification remove kael magnus --- apps/ops/notifications.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/ops/notifications.py b/apps/ops/notifications.py index d3018d929..46e9a5aa5 100644 --- a/apps/ops/notifications.py +++ b/apps/ops/notifications.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.template.loader import render_to_string from django.utils.translation import gettext from django.utils.translation import gettext_lazy as _ @@ -134,9 +135,10 @@ class ServerPerformanceCheckUtil(object): def initial_terminals(self): terminals = [] - for terminal in Terminal.objects.filter(is_deleted=False).exclude( - type__in=[TerminalType.core, TerminalType.celery] - ): + exclude_types = [TerminalType.core, TerminalType.celery, TerminalType.kael] + if not settings.XPACK_LICENSE_IS_VALID: + exclude_types.append(TerminalType.magnus) + for terminal in Terminal.objects.filter(is_deleted=False).exclude(type__in=exclude_types): if not terminal.is_active: continue terminal.stat = Status.get_terminal_latest_stat(terminal)