From ed832af6318e4ad35aecb2966f521b30b607f664 Mon Sep 17 00:00:00 2001 From: Aaron3S Date: Wed, 20 Sep 2023 18:14:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=BF=90=E8=A1=8Cjob?= =?UTF-8?q?=20=E7=BB=84=E7=BB=87=E5=88=87=E6=8D=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/tasks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/ops/tasks.py b/apps/ops/tasks.py index 045c8f1b9..01250c2bc 100644 --- a/apps/ops/tasks.py +++ b/apps/ops/tasks.py @@ -35,7 +35,12 @@ def job_task_activity_callback(self, job_id, *args, **kwargs): activity_callback=job_task_activity_callback ) def run_ops_job(job_id): - job = get_object_or_none(Job, id=job_id) + with tmp_to_root_org(): + job = get_object_or_none(Job, id=job_id) + if not job: + logger.error("Did not get the execution: {}".format(job_id)) + return + with tmp_to_org(job.org): execution = job.create_execution() execution.creator = job.creator