From 4018a59b2ee8d6f7c0f09e6880593a3561e94baa Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Tue, 17 Dec 2024 11:21:52 +0800 Subject: [PATCH] perf: Account backup filter org --- apps/accounts/models/automations/backup_account.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/accounts/models/automations/backup_account.py b/apps/accounts/models/automations/backup_account.py index 36c6fb1c2..3388a4b0a 100644 --- a/apps/accounts/models/automations/backup_account.py +++ b/apps/accounts/models/automations/backup_account.py @@ -14,13 +14,17 @@ from common.db import fields from common.db.encoder import ModelJSONFieldEncoder from common.utils import get_logger, lazyproperty from ops.mixin import PeriodTaskModelMixin -from orgs.mixins.models import OrgModelMixin, JMSOrgBaseModel +from orgs.mixins.models import OrgModelMixin, JMSOrgBaseModel, OrgManager __all__ = ['AccountBackupAutomation', 'AccountBackupExecution'] logger = get_logger(__file__) +class BaseBackupAutomationManager(OrgManager): + pass + + class AccountBackupAutomation(PeriodTaskModelMixin, JMSOrgBaseModel): types = models.JSONField(default=list) backup_type = models.CharField(max_length=128, choices=AccountBackupType.choices, @@ -47,6 +51,8 @@ class AccountBackupAutomation(PeriodTaskModelMixin, JMSOrgBaseModel): max_length=4096, blank=True, null=True, verbose_name=_('Zip encrypt password') ) + objects = BaseBackupAutomationManager.from_queryset(models.QuerySet)() + def __str__(self): return f'{self.name}({self.org_id})'