fix: 修复工单流500bug (#7784)

Co-authored-by: feng626 <1304903146@qq.com>
pull/7786/head
fit2bot 2022-03-10 11:26:34 +08:00 committed by GitHub
parent b017e68a56
commit 9725f0c963
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -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)