Skip to content

Commit 1277281

Browse files
committed
fix(portaswitch): handle dict and list inputs in custom contacts validator
1 parent 00f6fa1 commit 1277281

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/bss/adapters/portaswitch/config.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ def decode_contacts_custom(cls, v: Union[List, str]) -> List[dict]:
7171
if v is None or (isinstance(v, list) and len(v) == 0):
7272
return []
7373

74+
# If it's already a list of dicts, return it as-is
75+
if isinstance(v, list) and all(isinstance(item, dict) for item in v):
76+
return v
77+
78+
# If it's a single dict, wrap it in a list
79+
if isinstance(v, dict):
80+
return [v]
81+
7482
v = str(v)
7583

7684
if not v or not v.strip():

0 commit comments

Comments
 (0)