v1.1.11: normalize valueList CSV→array for nested dataDescriptor params
This commit is contained in:
@@ -71,7 +71,7 @@ def get_params_with_current_values(client, op_id, instance_uid):
|
||||
{
|
||||
k: {
|
||||
"dataType": v.get("dataType", ""),
|
||||
"valueList": v.get("valueList", ""),
|
||||
"valueList": _normalize_value_list(v.get("valueList", "")),
|
||||
"isRequired": v.get("isRequired", False),
|
||||
}
|
||||
for k, v in dd.items()
|
||||
@@ -81,3 +81,15 @@ def get_params_with_current_values(client, op_id, instance_uid):
|
||||
})
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def _normalize_value_list(vl):
|
||||
"""Nubes API возвращает valueList как CSV-строку или массив.
|
||||
Приводим к list для фронтенда."""
|
||||
if vl is None:
|
||||
return None
|
||||
if isinstance(vl, list):
|
||||
return vl
|
||||
if isinstance(vl, str):
|
||||
return [x.strip() for x in vl.split(',') if x.strip()] or None
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user