From 9725f0c963032b488ea096f088d26e0f00b715f0 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Thu, 10 Mar 2022 11:26:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E6=B5=81500bug=20(#7784)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng626 <1304903146@qq.com> --- apps/users/models/user.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/users/models/user.py b/apps/users/models/user.py index d071b9f66..5ff82b803 100644 --- a/apps/users/models/user.py +++ b/apps/users/models/user.py @@ -341,11 +341,18 @@ class RoleMixin: return RoleBinding.get_role_users(system_admin) @classmethod - def get_org_admins(cls, org=None): + def get_org_admins(cls): from rbac.models import Role, RoleBinding org_admin = Role.BuiltinRole.org_admin.get_role() return RoleBinding.get_role_users(org_admin) + @classmethod + def get_super_and_org_admins(cls): + super_admins = cls.get_super_admins() + org_admins = cls.get_org_admins() + admins = org_admins | super_admins + return admins.distinct() + @staticmethod def filter_not_service_account(queryset): return queryset.filter(is_service_account=False)