Browse Source

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

fix: 操作日志判断is_service_account为匿名用户会报错
pull/11322/head
老广 1 year ago committed by GitHub
parent
commit
737cae8d03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/audits/signal_handlers/operate_log.py

2
apps/audits/signal_handlers/operate_log.py

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

Loading…
Cancel
Save