From 71ffb71b87ce1371fd216e1a2261c62d237450b1 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Thu, 11 Sep 2014 16:31:02 -0400 Subject: [PATCH] Fix a bug where I wasn't checking for the right element in a survey when launching a job --- awx/main/models/jobs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/main/models/jobs.py b/awx/main/models/jobs.py index 9522663392..6bf9937149 100644 --- a/awx/main/models/jobs.py +++ b/awx/main/models/jobs.py @@ -214,8 +214,8 @@ class JobTemplate(UnifiedJobTemplate, JobOptions): @property def variables_needed_to_start(self): vars = [] - if self.survey_enabled: - for survey_element in self.survey_spec["spec"]: + if self.survey_enabled and 'spec' in self.survey_spec: + for survey_element in self.survey_spec['spec']: if survey_element['required']: vars.append(survey_element['variable']) return vars