From d3d87cbb95f619b3ca2382039054cd6200df624e Mon Sep 17 00:00:00 2001 From: Diogo Sousa Date: Wed, 25 Jan 2023 22:28:54 +0000 Subject: [PATCH] fix bug in applying configs --- openbb_terminal/session/local_model.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openbb_terminal/session/local_model.py b/openbb_terminal/session/local_model.py index f1b1ec61b30..908ec27b470 100644 --- a/openbb_terminal/session/local_model.py +++ b/openbb_terminal/session/local_model.py @@ -83,15 +83,13 @@ def apply_configs(configs: dict): configs : dict The configurations. """ + console.print(configs, style="red") if configs: keys = configs.get("features_keys", {}) if keys: for k, v in keys.items(): if hasattr(cfg, k): - if isinstance(getattr(cfg, k), int): - setattr(cfg, k, strtobool(v)) - else: - setattr(cfg, k, v) + setattr(cfg, k, v) # Since settings come from different files we use the format {var_name: "path:value"} settings = configs.get("features_settings", {}) @@ -102,7 +100,9 @@ def apply_configs(configs: dict): module = importlib.import_module(path) if hasattr(module, var_name): - if isinstance(getattr(module, var_name), int): + if value.lower() in ["true", "false"]: setattr(module, var_name, strtobool(value)) + elif isinstance(getattr(module, var_name), int): + setattr(module, var_name, int(value)) else: setattr(module, var_name, value)