From 141dafc8bfc32bc2edc2ce817d3f0569acf32cb5 Mon Sep 17 00:00:00 2001 From: Michael Bai Date: Thu, 28 Oct 2021 10:56:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=9B=E5=BB=BA=E6=8E=88=E6=9D=83/?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B5=84=E4=BA=A7=E5=88=B0=E8=8A=82=E7=82=B9?= =?UTF-8?q?=EF=BC=9B=E4=B8=8D=E5=86=8D=E8=87=AA=E5=8A=A8=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=B5=84=E4=BA=A7=E7=9A=84=E7=AE=A1=E7=90=86=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/signals_handler/authbook.py | 4 +++- apps/assets/tasks/common.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/assets/signals_handler/authbook.py b/apps/assets/signals_handler/authbook.py index f42d8627e..513488763 100644 --- a/apps/assets/signals_handler/authbook.py +++ b/apps/assets/signals_handler/authbook.py @@ -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) diff --git a/apps/assets/tasks/common.py b/apps/assets/tasks/common.py index ad2749e29..06b656e24 100644 --- a/apps/assets/tasks/common.py +++ b/apps/assets/tasks/common.py @@ -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()