fix: 从组织移除用户

pull/7822/head^2
Jiangjie.Bai 3 years ago committed by Jiangjie.Bai
parent 8423ae602f
commit a876a82a76

@ -14,6 +14,7 @@ from orgs.models import Organization
from orgs.hands import set_current_org, Node, get_current_org from orgs.hands import set_current_org, Node, get_current_org
from perms.models import (AssetPermission, ApplicationPermission) from perms.models import (AssetPermission, ApplicationPermission)
from users.models import UserGroup, User from users.models import UserGroup, User
from assets.models import SystemUser
from common.const.signals import PRE_REMOVE, POST_REMOVE from common.const.signals import PRE_REMOVE, POST_REMOVE
from common.decorator import on_transaction_commit from common.decorator import on_transaction_commit
from common.signals import django_ready from common.signals import django_ready
@ -135,7 +136,7 @@ def _clear_users_from_org(org, users):
if not users: if not users:
return return
models = (AssetPermission, ApplicationPermission, UserGroup) models = (AssetPermission, ApplicationPermission, UserGroup, SystemUser)
for m in models: for m in models:
_remove_users(m, users, org) _remove_users(m, users, org)

Loading…
Cancel
Save