Merge pull request #11320 from jumpserver/pr@dev@fix_operatelog_not_record_component

fix: 操作日志判断is_service_account为匿名用户会报错
pull/11322/head
老广 2023-08-17 16:29:04 +08:00 committed by GitHub
commit 737cae8d03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ def signal_of_operate_log_whether_continue(
condition = False
# 不记录组件的操作日志
user = current_request.user if current_request else None
if not user or user.is_service_account:
if not user or getattr(user, 'is_service_account', False):
condition = False
# 终端模型的 create 事件由系统产生,不记录
if instance._meta.object_name == 'Terminal' and created: