mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
fix KeyError with spec
This commit is contained in:
@@ -2421,7 +2421,7 @@ class JobTemplateSurveySpec(GenericAPIView):
|
|||||||
raise LicenseForbids(_('Your license does not allow '
|
raise LicenseForbids(_('Your license does not allow '
|
||||||
'adding surveys.'))
|
'adding surveys.'))
|
||||||
survey_spec = obj.survey_spec
|
survey_spec = obj.survey_spec
|
||||||
for pos, field in enumerate(survey_spec['spec']):
|
for pos, field in enumerate(survey_spec.get('spec', [])):
|
||||||
if field.get('type') == 'password':
|
if field.get('type') == 'password':
|
||||||
if 'default' in field and field['default']:
|
if 'default' in field and field['default']:
|
||||||
field['default'] = '$encrypted$'
|
field['default'] = '$encrypted$'
|
||||||
|
|||||||
Reference in New Issue
Block a user