Return survey_enabled as False for launch endpoint when no survey spec is defined for a job template; allow job template to be launched anyways. Fixes https://trello.com/c/zErQqf1L

This commit is contained in:
Chris Church
2015-04-10 16:20:57 -04:00
parent 3b66dbed03
commit fd09cc3726
3 changed files with 13 additions and 7 deletions

View File

@@ -229,7 +229,7 @@ class JobTemplate(UnifiedJobTemplate, JobOptions):
errors.append("'name' missing from survey spec")
if 'description' not in self.survey_spec:
errors.append("'description' missing from survey spec")
for survey_element in self.survey_spec["spec"]:
for survey_element in self.survey_spec.get("spec", []):
if survey_element['variable'] not in data and \
survey_element['required']:
errors.append("'%s' value missing" % survey_element['variable'])