Open mkanoor opened 2 years ago
I believe the culprit is here: https://github.com/ansible/awx/blob/6a17e5b65bf9421c2e650d23817c79ce81248c6f/awx/api/views/__init__.py#L2568
If what is passed in is a list instead of a string, as you can do in the API, this block of code that standardizes the input for this entry will be bypassed.
Please confirm the following
Summary
In the AAP UI when choices are added for a multi select field they are stored as a string with \n as the delimiter. e.g
choices: "NJ\nPA\OK"
The REST API allows for the choices to be stored as an array of strings e.g.So if someone uses a REST API to add a Survey spec and specifies an array/list of strings the REST API call succeeds and stores the value but when the UI tries to display it fails.
AWX version
AWX 4.0.0
Installation method
openshift
Modifications
no
Ansible version
No response
Operating system
Linux
Web browser
Chrome
Steps to reproduce
Create a Job Template Add a Survey Spec for the Job Template using a REST API with the following payload
After the Survey Spec has been created click on the Survey Spec "state" field and the UI gets an error
Survey Spec
Expected results
The UI should be able to display the survey spec item or reject the REST API call when arrays are used for choices.
Actual results
The REST API call succeeds for both GET and POST but the UI fails.
Additional information
No response