Allow empty default values for numerical survey answers.

Signed-off-by: Vismay Golwala <vgolwala@redhat.com>
This commit is contained in:
Vismay Golwala
2019-02-12 11:38:54 -05:00
parent 570283fba2
commit 4f13255f35
2 changed files with 9 additions and 1 deletions

View File

@@ -2509,7 +2509,7 @@ class JobTemplateSurveySpec(GenericAPIView):
).format(
allowed_types=', '.join(JobTemplateSurveySpec.ALLOWED_TYPES.keys()), **context
)))
if 'default' in survey_item:
if 'default' in survey_item and survey_item['default'] != '':
if not isinstance(survey_item['default'], JobTemplateSurveySpec.ALLOWED_TYPES[qtype]):
type_label = 'string'
if qtype in ['integer', 'float']: