mirror of
https://github.com/sartography/spiffworkflow-backend.git
synced 2025-02-23 21:08:18 +00:00
more checking
This commit is contained in:
parent
d1c1e6069c
commit
ac16fc8be1
@ -1390,25 +1390,28 @@ def _update_form_schema_with_task_data_as_needed(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
select_options_from_task_data = task_data.get(
|
select_options_from_task_data = task_data.get(task_data_var)
|
||||||
task_data_var
|
if isinstance(select_options_from_task_data, list):
|
||||||
)
|
if all(
|
||||||
|
"value" in d and "label" in d
|
||||||
|
for d in select_options_from_task_data
|
||||||
|
):
|
||||||
|
|
||||||
def map_function(
|
def map_function(
|
||||||
task_data_select_option: TaskDataSelectOption,
|
task_data_select_option: TaskDataSelectOption,
|
||||||
) -> ReactJsonSchemaSelectOption:
|
) -> ReactJsonSchemaSelectOption:
|
||||||
"""Map_function."""
|
"""Map_function."""
|
||||||
return {
|
return {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [task_data_select_option["value"]],
|
"enum": [task_data_select_option["value"]],
|
||||||
"title": task_data_select_option["label"],
|
"title": task_data_select_option["label"],
|
||||||
}
|
}
|
||||||
|
|
||||||
options_for_react_json_schema_form = list(
|
options_for_react_json_schema_form = list(
|
||||||
map(map_function, select_options_from_task_data)
|
map(map_function, select_options_from_task_data)
|
||||||
)
|
)
|
||||||
|
|
||||||
in_dict[k] = options_for_react_json_schema_form
|
in_dict[k] = options_for_react_json_schema_form
|
||||||
elif isinstance(value, dict):
|
elif isinstance(value, dict):
|
||||||
_update_form_schema_with_task_data_as_needed(value, task_data)
|
_update_form_schema_with_task_data_as_needed(value, task_data)
|
||||||
elif isinstance(value, list):
|
elif isinstance(value, list):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user