From 873c019b5874949781f47baa3157dad636874a5c Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 9 May 2023 17:23:21 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=20job=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/api/job.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/ops/api/job.py b/apps/ops/api/job.py index eb04efbfa..308998f09 100644 --- a/apps/ops/api/job.py +++ b/apps/ops/api/job.py @@ -73,6 +73,7 @@ class JobExecutionViewSet(OrgBulkModelViewSet): http_method_names = ('get', 'post', 'head', 'options',) model = JobExecution search_fields = ('material',) + filterset_fields = ['status', 'job_id'] @atomic def perform_create(self, serializer): @@ -88,9 +89,6 @@ class JobExecutionViewSet(OrgBulkModelViewSet): def get_queryset(self): queryset = super().get_queryset() queryset = queryset.filter(creator=self.request.user) - job_id = self.request.query_params.get('job_id') - if job_id: - queryset = queryset.filter(job_id=job_id) return queryset