perf: 修改 job list

pull/10409/head
ibuler 2023-05-09 17:23:21 +08:00
parent b5599fd3a6
commit 873c019b58
1 changed files with 1 additions and 3 deletions

View File

@ -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