Skip to content

Commit

Permalink
Rebas
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Sep 21, 2024
1 parent 918652e commit 4185fe1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/galaxy/tools/parameters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -704,6 +707,7 @@ def fill_dynamic_defaults(
request_context,
repeat_input.inputs,
rep,
context=context,
)

elif input.type == "conditional":
Expand All @@ -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.")
Expand All @@ -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

Expand Down

0 comments on commit 4185fe1

Please sign in to comment.