Merge pull request #9625 from jumpserver/pr@dev@fix_clean_activity_with_operation

fix: 解决跨组织资源的Activty在其他组织下404的问题
pull/9627/head
老广 2023-02-19 20:05:42 +08:00 committed by GitHub
commit 7ea9b4d429
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -12,7 +12,6 @@ from common.api import JMSGenericViewSet
from common.drf.filters import DatetimeRangeFilter
from common.plugins.es import QuerySet as ESQuerySet
from orgs.mixins.api import OrgGenericViewSet, OrgBulkModelViewSet
from orgs.models import Organization
from orgs.utils import current_org, tmp_to_root_org
from users.models import User
from .backends import TYPE_ENGINE_MAPPING
@ -149,9 +148,7 @@ class OperateLogViewSet(RetrieveModelMixin, ListModelMixin, OrgGenericViewSet):
def get_queryset(self):
with tmp_to_root_org():
qs = OperateLog.objects.filter(
Q(org_id=current_org.id) | Q(org_id=Organization.SYSTEM_ID)
)
qs = OperateLog.objects.all()
es_config = settings.OPERATE_LOG_ELASTICSEARCH_CONFIG
if es_config:
engine_mod = import_module(TYPE_ENGINE_MAPPING['es'])