From f6a26ac1658ad4bfc971033fccdc1e52fdfd4b46 Mon Sep 17 00:00:00 2001 From: xinwen Date: Mon, 12 Jul 2021 20:23:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=A8=E5=B1=80=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E8=AE=B0=E5=BD=95=E6=97=A0=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/filters.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/apps/terminal/filters.py b/apps/terminal/filters.py index 81f548162..79f4048fe 100644 --- a/apps/terminal/filters.py +++ b/apps/terminal/filters.py @@ -1,7 +1,7 @@ from django_filters import rest_framework as filters from django.db.models import QuerySet -from orgs.utils import current_org +from orgs.utils import current_org, filter_org_queryset from terminal.models import Command, CommandStorage @@ -26,7 +26,7 @@ class CommandFilter(filters.FilterSet): @property def qs(self): qs = super().qs - qs = qs.filter(org_id=self.get_org_id()) + qs = filter_org_queryset(qs) qs = self.filter_by_timestamp(qs) return qs @@ -46,11 +46,6 @@ class CommandFilter(filters.FilterSet): qs = qs.filter(**filters) return qs - @staticmethod - def get_org_id(): - org_id = current_org.id - return org_id - class CommandFilterForStorageTree(CommandFilter): asset = filters.CharFilter(method='do_nothing')