From dfa3f4b53b2adab3bab78d9b54bd9d0c9a44b6e5 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 28 Feb 2023 13:35:17 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=8E=A8=E9=80=81=E8=B4=A6=E5=8F=B7=20?= =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=89=88=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=85=B3=E9=97=AD=20(#9804)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng <1304903146@qq.com> --- apps/accounts/models/automations/push_account.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/accounts/models/automations/push_account.py b/apps/accounts/models/automations/push_account.py index 411e8cb12..a8bc2fdff 100644 --- a/apps/accounts/models/automations/push_account.py +++ b/apps/accounts/models/automations/push_account.py @@ -2,6 +2,7 @@ from django.db import models from django.utils.translation import ugettext_lazy as _ from accounts.const import AutomationTypes +from jumpserver.utils import has_valid_xpack_license from .base import AccountBaseAutomation from .change_secret import ChangeSecretMixin @@ -27,6 +28,8 @@ class PushAccountAutomation(ChangeSecretMixin, AccountBaseAutomation): def save(self, *args, **kwargs): self.type = AutomationTypes.push_account + if not has_valid_xpack_license(): + self.is_periodic = False super().save(*args, **kwargs) def to_attr_json(self):