From 16028a21c48a45794438a5af8fe997cd06b5351c Mon Sep 17 00:00:00 2001 From: Jules Bertrand <33326907+julesbertrand@users.noreply.github.com> Date: Fri, 1 Mar 2024 12:09:41 +0100 Subject: [PATCH] fix: instanciate list only if not ixisting when paring errors (#161) --- deployer/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployer/utils/utils.py b/deployer/utils/utils.py index 1bd6cc7..968757e 100644 --- a/deployer/utils/utils.py +++ b/deployer/utils/utils.py @@ -316,7 +316,7 @@ def _parse_validation_errors( else: config_name = error["loc"][3] error_row = {"type": error["type"], "msg": error["msg"]} - parsed_errors[pipeline_name][config_name] = [] + parsed_errors[pipeline_name].setdefault(config_name, []) if len(error["loc"]) > 4: error_row["field"] = error["loc"][5] parsed_errors[pipeline_name][config_name].append(error_row)