Code generation improvement for select_option action - use label if value is not present (#3973)
This commit is contained in:
@@ -335,6 +335,8 @@ def _action_to_stmt(act: dict[str, Any], task: dict[str, Any], assign_to_output:
|
|||||||
elif method == "select_option":
|
elif method == "select_option":
|
||||||
option = act.get("option", {})
|
option = act.get("option", {})
|
||||||
value = option.get("value")
|
value = option.get("value")
|
||||||
|
label = option.get("label")
|
||||||
|
value = value or label
|
||||||
if value:
|
if value:
|
||||||
if act.get("field_name"):
|
if act.get("field_name"):
|
||||||
option_value = cst.Subscript(
|
option_value = cst.Subscript(
|
||||||
|
|||||||
Reference in New Issue
Block a user