diff --git a/apps/ops/tasks.py b/apps/ops/tasks.py index 11ad27aa4..1fe0fbe7c 100644 --- a/apps/ops/tasks.py +++ b/apps/ops/tasks.py @@ -64,7 +64,13 @@ def job_execution_task_activity_callback(self, execution_id, *args, **kwargs): activity_callback=job_execution_task_activity_callback ) def run_ops_job_execution(execution_id, **kwargs): - execution = get_object_or_none(JobExecution, id=execution_id) + with tmp_to_root_org(): + execution = get_object_or_none(JobExecution, id=execution_id) + + if not execution: + logger.error("Did not get the execution: {}".format(execution_id)) + return + try: with tmp_to_org(execution.org): execution.start()