mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 05:29:26 -02:30
fix KeyError for default, added tests
This commit is contained in:
@@ -127,8 +127,8 @@ class SurveyJobTemplateMixin(models.Model):
|
||||
# Overwrite with job template extra vars with survey default vars
|
||||
if self.survey_enabled and 'spec' in self.survey_spec:
|
||||
for survey_element in self.survey_spec.get("spec", []):
|
||||
default = survey_element['default']
|
||||
variable_key = survey_element['variable']
|
||||
default = survey_element.get('default')
|
||||
variable_key = survey_element.get('variable')
|
||||
if survey_element.get('type') == 'password':
|
||||
if variable_key in kwargs_extra_vars:
|
||||
kw_value = kwargs_extra_vars[variable_key]
|
||||
|
||||
Reference in New Issue
Block a user