From cc8680564d259313042b211c0d40fa818b32059a Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 22 Sep 2023 12:20:33 +0300 Subject: Add email alerts --- app/utils.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'app/utils.py') diff --git a/app/utils.py b/app/utils.py index 6deb147..5401c5c 100644 --- a/app/utils.py +++ b/app/utils.py @@ -22,7 +22,11 @@ def get_config(config: dict[str, Any], key: str) -> Any: except KeyError: raise Exception(f"no {key} field in config: " + str(config)) - return evaluate_env_ref(v) + if type(v) == list: + mapped = map(evaluate_env_ref, v) + return list(mapped) + else: + return evaluate_env_ref(v) def get_config_or_default( @@ -30,7 +34,11 @@ def get_config_or_default( ) -> Any: v: Any = config.get(key, default) - return evaluate_env_ref(v) + if type(v) == list: + mapped = map(evaluate_env_ref, v) + return list(mapped) + else: + return evaluate_env_ref(v) def item_to_dict(item: Item) -> ItemDict: -- cgit v1.3