From 4960c4b260432b437212f8e5e88b9f3205060e29 Mon Sep 17 00:00:00 2001 From: Bai Date: Fri, 3 Feb 2023 19:53:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E8=B5=84=E4=BA=A7ACL=E4=BC=9A=E8=8E=B7=E5=8F=96=E6=89=80?= =?UTF-8?q?=E6=9C=89=E7=BB=84=E7=BB=87=E4=B8=8B=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/acls/models/base.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/acls/models/base.py b/apps/acls/models/base.py index 014fec8bd..061fcfd01 100644 --- a/apps/acls/models/base.py +++ b/apps/acls/models/base.py @@ -62,11 +62,15 @@ class UserAssetAccountACLQuerySet(BaseACLQuerySet): return self.filter(q) -class ACLManager(OrgManager): +class ACLManager(models.Manager): def valid(self): return self.get_queryset().valid() +class OrgACLManager(OrgManager, ACLManager): + pass + + class BaseACL(JMSBaseModel): name = models.CharField(max_length=128, verbose_name=_('Name')) priority = models.IntegerField( @@ -97,7 +101,7 @@ class UserAssetAccountBaseACL(BaseACL, OrgModelMixin): # username_group accounts = models.JSONField(verbose_name=_('Account')) - objects = ACLManager.from_queryset(UserAssetAccountACLQuerySet)() + objects = OrgACLManager.from_queryset(UserAssetAccountACLQuerySet)() class Meta(BaseACL.Meta): unique_together = ('name', 'org_id')