mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
Fix bug where API assumed survey choices were list
Applies to both single-select and multi-select type questions. UI sends choices in the form of text with line breaks separating the options. Customer complained about empty string erronously sent by the UI being passed to playbook, which is a component of this.
This commit is contained in:
@@ -135,13 +135,15 @@ def create_survey_spec(variables=None, default_type='integer', required=True):
|
||||
argument specifying variable name(s)
|
||||
'''
|
||||
if isinstance(variables, list):
|
||||
name = "%s survey" % variables[0]
|
||||
description = "A survey that starts with %s." % variables[0]
|
||||
vars_list = variables
|
||||
else:
|
||||
name = "%s survey" % variables
|
||||
description = "A survey about %s." % variables
|
||||
vars_list = [variables]
|
||||
if isinstance(variables[0], basestring):
|
||||
slogan = variables[0]
|
||||
else:
|
||||
slogan = variables[0].get('question_name', 'something')
|
||||
name = "%s survey" % slogan
|
||||
description = "A survey that asks about %s." % slogan
|
||||
|
||||
spec = []
|
||||
index = 0
|
||||
|
||||
Reference in New Issue
Block a user