fix: job execution stop failed

pull/14510/head
Bai 2024-11-21 18:36:36 +08:00 committed by w940853815
parent 6db56eb2aa
commit d2f7376f78
1 changed files with 2 additions and 2 deletions

View File

@ -228,9 +228,9 @@ class JobExecutionViewSet(OrgBulkModelViewSet):
try:
user = request.user
if user.has_perm("audits.view_joblog"):
instance = get_object_or_404(JobExecution, pk=task_id)
instance = get_object_or_404(JobExecution, task_id=task_id)
else:
instance = get_object_or_404(JobExecution, pk=task_id, creator=request.user)
instance = get_object_or_404(JobExecution, task_id=task_id, creator=request.user)
except Http404:
return Response(
{'error': _('The task is being created and cannot be interrupted. Please try again later.')},