From df9bb829fcfd1b23a15147c1a8503fb03915389d Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Tue, 24 Jan 2017 16:53:48 -0500 Subject: [PATCH] fix KeyError with spec --- awx/api/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/api/views.py b/awx/api/views.py index 63321ac537..57ede93ded 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -2421,7 +2421,7 @@ class JobTemplateSurveySpec(GenericAPIView): raise LicenseForbids(_('Your license does not allow ' 'adding surveys.')) 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 'default' in field and field['default']: field['default'] = '$encrypted$'