1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Fix a bug where I wasn't checking for the right element in a survey when

launching a job
This commit is contained in:
Matthew Jones 2014-09-11 16:31:02 -04:00
parent c6993ae44a
commit 71ffb71b87

View File

@ -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