From df1d6ebc7ecad701dc78524cadf44b0186d6d87b Mon Sep 17 00:00:00 2001 From: Chris Church Date: Sun, 31 Mar 2013 23:25:54 -0400 Subject: [PATCH] Added back try/except for TaskMeta lookup. --- lib/main/models/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/main/models/__init__.py b/lib/main/models/__init__.py index 461ac0b2eb..7bfdf7d320 100644 --- a/lib/main/models/__init__.py +++ b/lib/main/models/__init__.py @@ -616,8 +616,11 @@ class LaunchJob(CommonModel): from lib.main.tasks import run_launch_job launch_job_status = self.launch_job_statuses.create(name='Launch Job Status %s' % now().isoformat()) task_result = run_launch_job.delay(launch_job_status.pk) - launch_job_status.celery_task = TaskMeta.objects.get(task_id=task_result.task_id) - launch_job_status.save() + try: + launch_job_status.celery_task = TaskMeta.objects.get(task_id=task_result.task_id) + launch_job_status.save() + except TaskMeta.DoesNotExist: + pass return launch_job_status # project has one default playbook but really should have a list of playbooks and flags ...