perf: 资产acl拒绝后没记录操作日志 (#11868)

Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
fit2bot
2023-10-17 14:28:19 +08:00
committed by GitHub
parent 741705b85b
commit 73b75df524
3 changed files with 12 additions and 4 deletions

View File

@@ -218,10 +218,10 @@ class OperateLogViewSet(OrgReadonlyModelViewSet):
return super().get_serializer_class()
def get_queryset(self):
org_q = Q()
qs = OperateLog.objects.all()
if self.is_action_detail:
org_q |= Q(org_id=Organization.SYSTEM_ID)
qs = OperateLog.objects.filter(org_q)
with tmp_to_root_org():
qs |= OperateLog.objects.filter(org_id=Organization.SYSTEM_ID)
es_config = settings.OPERATE_LOG_ELASTICSEARCH_CONFIG
if es_config:
engine_mod = import_module(TYPE_ENGINE_MAPPING['es'])