fix: 修复运行job 组织切换问题

pull/11637/head
Aaron3S 1 year ago committed by Bryan
parent 948c499d9e
commit ed832af631

@ -35,7 +35,12 @@ def job_task_activity_callback(self, job_id, *args, **kwargs):
activity_callback=job_task_activity_callback activity_callback=job_task_activity_callback
) )
def run_ops_job(job_id): def run_ops_job(job_id):
with tmp_to_root_org():
job = get_object_or_none(Job, id=job_id) 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): with tmp_to_org(job.org):
execution = job.create_execution() execution = job.create_execution()
execution.creator = job.creator execution.creator = job.creator

Loading…
Cancel
Save