From 16333fa1aa10ea44e11f39fd272d58852af1e913 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 13 Jul 2021 18:03:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/signals_handler/authbook.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/assets/signals_handler/authbook.py b/apps/assets/signals_handler/authbook.py index 0c6635c4c..acc996911 100644 --- a/apps/assets/signals_handler/authbook.py +++ b/apps/assets/signals_handler/authbook.py @@ -18,7 +18,11 @@ def pre_create_historical_record_callback(sender, instance=None, history_instanc for attr in attrs_to_copy: if getattr(history_instance, attr): continue - if not history_instance.systemuser: + try: + system_user = history_instance.systemuser + except SystemUser.DoesNotExist: + continue + if not system_user: continue system_user_attr_value = getattr(history_instance.systemuser, attr) if system_user_attr_value: