From e36cd17c161c21c744bd4654f605e2b47cd702a5 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Mon, 20 Feb 2017 16:49:29 -0500 Subject: [PATCH] fix a minor bug in survey_spec password field handling see: #5477 --- 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 d80f7ad578..33cff82049 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -2487,7 +2487,7 @@ class JobTemplateSurveySpec(GenericAPIView): return Response(dict(error=_("'required' missing from survey question %s.") % str(idx)), status=status.HTTP_400_BAD_REQUEST) if survey_item["type"] == "password": - if "default" in survey_item and survey_item["default"].startswith('$encrypted$'): + if survey_item.get("default") and survey_item["default"].startswith('$encrypted$'): old_spec = obj.survey_spec for old_item in old_spec['spec']: if old_item['variable'] == survey_item['variable']: