fix: es命令记录可以看到其他资产执行的命令

This commit is contained in:
wangruidong
2023-12-20 17:45:18 +08:00
committed by Bryan
parent 9f67ba573c
commit 98c9cddcbf
3 changed files with 27 additions and 11 deletions

View File

@@ -167,7 +167,6 @@ class CommandViewSet(JMSBulkModelViewSet):
def get_queryset(self):
command_storage_id = self.request.query_params.get('command_storage_id')
asset_id = self.request.query_params.get('asset_id')
if not command_storage_id:
return Command.objects.none()
@@ -176,9 +175,6 @@ class CommandViewSet(JMSBulkModelViewSet):
raise StorageInvalid
else:
qs = storage.get_command_queryset()
if asset_id:
session_ids = Session.objects.filter(asset_id=asset_id).values_list('id', flat=True)
qs = qs.filter(session__in=list(session_ids))
return qs
def create(self, request, *args, **kwargs):