From 1f30d459ae5a624b1e6f45d946a839e8bdbf29b1 Mon Sep 17 00:00:00 2001 From: Bai Date: Wed, 15 Jul 2020 16:55:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(command):=20=E4=BF=AE=E5=A4=8D=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E8=AE=B0=E5=BD=95=E6=B2=A1=E6=9C=89=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?sesion=E8=BF=9B=E8=A1=8C=E8=BF=87=E6=BB=A4=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/api/command.py | 7 ++++--- apps/terminal/backends/command/base.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/terminal/api/command.py b/apps/terminal/api/command.py index f98fa0e7c..d18c70858 100644 --- a/apps/terminal/api/command.py +++ b/apps/terminal/api/command.py @@ -55,14 +55,15 @@ class CommandQueryMixin: q = self.request.query_params multi_command_storage = get_multi_command_storage() queryset = multi_command_storage.filter( - date_from=date_from, date_to=date_to, input=q.get("input"), - user=q.get("user"), asset=q.get("asset"), - system_user=q.get("system_user"), + date_from=date_from, date_to=date_to, + user=q.get("user"), asset=q.get("asset"), system_user=q.get("system_user"), + input=q.get("input"), session=q.get("session_id"), risk_level=self.get_query_risk_level(), org_id=self.get_org_id(), ) return queryset def filter_queryset(self, queryset): + # 解决es存储命令时,父类根据filter_fields过滤出现异常的问题,返回的queryset类型list return queryset def get_date_range(self): diff --git a/apps/terminal/backends/command/base.py b/apps/terminal/backends/command/base.py index d95697ed0..4bb85e127 100644 --- a/apps/terminal/backends/command/base.py +++ b/apps/terminal/backends/command/base.py @@ -16,7 +16,7 @@ class CommandBase(object): @abc.abstractmethod def filter(self, date_from=None, date_to=None, user=None, asset=None, system_user=None, - input=None, session=None): + input=None, session=None, risk_level=None, org_id=None): pass @abc.abstractmethod