Skip to content

Commit

Permalink
fix: wrong save property place, we skip non_interactive user_choice
Browse files Browse the repository at this point in the history
  • Loading branch information
Romazes committed Aug 15, 2024
1 parent 2d45ce1 commit 14c6c93
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lean/models/json_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,18 @@ def config_build(self,
if interactive:
default_value = configuration._input_default
user_choice = configuration.ask_user_for_input(default_value, logger, hide_input=hide_input)

if not isinstance(configuration, BrokerageEnvConfiguration):
self._save_property({f"{configuration._id}": user_choice})
else:
if configuration._input_default != None and configuration._optional:
# if optional and we have a default input value and the user didn't provider it we use it
user_choice = configuration._input_default
else:
missing_options.append(f"--{configuration._id}")

if not isinstance(configuration, BrokerageEnvConfiguration):
logger.debug(f"Retaining configuration ID '{configuration._id}' as '{user_choice}' "
f"in the configuration file.")
self._save_property({f"{configuration._id}": user_choice})

configuration._value = user_choice

if len(missing_options) > 0:
Expand Down

0 comments on commit 14c6c93

Please sign in to comment.