From 381b150c2b2a96a4d2f394b9ec067c04a58af916 Mon Sep 17 00:00:00 2001 From: xinwen Date: Wed, 14 Jul 2021 21:31:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8E=A2=E6=B5=8B=20authbook=20?= =?UTF-8?q?=E5=9C=A8=20root=20=E7=BB=84=E7=BB=87=E4=B8=8B=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/signals_handler/asset.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/assets/signals_handler/asset.py b/apps/assets/signals_handler/asset.py index de81563f4..be47a2505 100644 --- a/apps/assets/signals_handler/asset.py +++ b/apps/assets/signals_handler/asset.py @@ -5,6 +5,7 @@ from django.db.models.signals import ( ) from django.dispatch import receiver +from orgs.utils import ensure_in_real_or_default_org from common.const.signals import POST_ADD, POST_REMOVE, PRE_REMOVE from common.utils import get_logger from common.decorator import on_transaction_commit @@ -18,6 +19,12 @@ from assets.tasks import ( logger = get_logger(__file__) +@receiver(m2m_changed, sender=SystemUser.assets.through) +@ensure_in_real_or_default_org +def on_asset_system_user_change(sender, **kwargs): + pass + + def update_asset_hardware_info_on_created(asset): logger.debug("Update asset `{}` hardware info".format(asset)) update_assets_hardware_info_util.delay([asset])