fix: 创建授权/添加资产到节点;不再自动更新资产的管理用户

pull/7102/head
Michael Bai 2021-10-28 10:56:39 +08:00 committed by 老广
parent 28a6024b49
commit 141dafc8bf
2 changed files with 5 additions and 2 deletions

View File

@ -37,8 +37,10 @@ def on_authbook_post_delete(sender, instance, **kwargs):
def on_authbook_post_create(sender, instance, created, **kwargs):
instance.sync_to_system_user_account()
if created:
pass
# # 不再自动更新资产管理用户,只允许用户手动指定。
# 只在创建时进行更新资产的管理用户
instance.update_asset_admin_user_if_need()
# instance.update_asset_admin_user_if_need()
@receiver(pre_save, sender=AuthBook)

View File

@ -23,5 +23,6 @@ def add_nodes_assets_to_system_users(nodes_keys, system_users):
instance, created = AuthBook.objects.update_or_create(
defaults=defaults, asset=asset, systemuser=system_user
)
# # 不再自动更新资产管理用户,只允许用户手动指定。
# 只要关联都需要更新资产的管理用户
instance.update_asset_admin_user_if_need()
# instance.update_asset_admin_user_if_need()