From 4185fe1092f4bf6c90d3bcd2947518187b86fdef Mon Sep 17 00:00:00 2001 From: John Chilton Date: Sat, 21 Sep 2024 17:58:19 -0400 Subject: [PATCH] Rebas --- lib/galaxy/tools/parameters/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/tools/parameters/__init__.py b/lib/galaxy/tools/parameters/__init__.py index 327ad7923695..4dea901cac9c 100644 --- a/lib/galaxy/tools/parameters/__init__.py +++ b/lib/galaxy/tools/parameters/__init__.py @@ -692,10 +692,13 @@ def fill_dynamic_defaults( request_context, inputs: ToolInputsT, incoming: ToolStateJobInstanceT, + context=None, ): """ Expands incoming parameters with default values. """ + if context is None: + context = flat_to_nested_state(incoming) for input in inputs.values(): if input.type == "repeat": repeat_input = cast(Repeat, input) @@ -704,6 +707,7 @@ def fill_dynamic_defaults( request_context, repeat_input.inputs, rep, + context=context, ) elif input.type == "conditional": @@ -716,6 +720,7 @@ def fill_dynamic_defaults( request_context, conditional_input.cases[current_case].inputs, cast(ToolStateJobInstanceT, incoming.get(conditional_input.name)), + context=context, ) except Exception: raise Exception("The selected case is unavailable/invalid.") @@ -726,16 +731,14 @@ def fill_dynamic_defaults( request_context, section_input.inputs, cast(ToolStateJobInstanceT, incoming.get(section_input.name)), + context=context, ) - if section_errors: - errors[section_input.name] = section_errors elif input.type == "upload_dataset": raise NotImplementedError else: if input.name not in incoming: - context = ExpressionContext(incoming, context) param_value = input.get_initial_value(request_context, context) incoming[input.name] = param_value