fix: 修复管理用户批量删除失败的bug

pull/6431/head
ibuler 2021-07-13 18:03:07 +08:00 committed by Jiangjie.Bai
parent 72deb005a6
commit 16333fa1aa
1 changed files with 5 additions and 1 deletions

View File

@ -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: