From 040d23de3268ab4f897166102d337f24a83f2086 Mon Sep 17 00:00:00 2001 From: emesika Date: Mon, 4 Dec 2023 13:12:22 +0200 Subject: [PATCH] Fixing issue #160 code : if parse_type[0].startswith("ns"): cls._cls_suds_map[local_name]["cls"] = globals()[parse_type[1]] cls._cls_suds_map[local_name]["enum_id"] = getattr(cft, "enum_id", None) cls._cls_suds_map[local_name]["is_custom"] = True cls._cls_suds_map[local_name]["control"] = cls._wi_type Error : File "/home/emesika/.local/lib/python3.9/site-packages/pylero/work_item.py", line 1464, in get_custom_fields print(f"Global = {globals()[parse_type[1]]}") KeyError: 'duration' Happens on : local name = sprint_estimate parse_type = duration should skip non existing parse_type[1] in globals() : if parse_type[0].startswith("ns"): if parse_type[1] not in globals(): continue cls._cls_suds_map[local_name]["cls"] = globals()[parse_type[1]] cls._cls_suds_map[local_name]["enum_id"] = getattr(cft, "enum_id", None) cls._cls_suds_map[local_name]["is_custom"] = True cls._cls_suds_map[local_name]["control"] = cls._wi_type Signed-off-by: Eli Mesika --- src/pylero/work_item.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pylero/work_item.py b/src/pylero/work_item.py index b6c0c68..240b297 100644 --- a/src/pylero/work_item.py +++ b/src/pylero/work_item.py @@ -1459,6 +1459,8 @@ def get_custom_fields(cls, project_id): # for all object types, I need special processing. parse_type = cft.type.split(":") if parse_type[0].startswith("ns"): + if parse_type[1] not in globals(): + continue cls._cls_suds_map[local_name]["cls"] = globals()[parse_type[1]] cls._cls_suds_map[local_name]["enum_id"] = getattr(cft, "enum_id", None) cls._cls_suds_map[local_name]["is_custom"] = True