Skip to content

Commit

Permalink
Merge pull request #1 from bookingsuedtirol/refactor/features-bugfixing
Browse files Browse the repository at this point in the history
fix: fix type checking
  • Loading branch information
AlexFRAN authored Sep 9, 2024
2 parents 5e71dc8 + e2cd0ff commit 492b91a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mss_python/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def refine_getHotelList(resp: dict) -> dict:
return resp
elif "hotel" not in resp["result"] or resp["result"]["hotel"] is None:
return resp
elif resp["result"]["hotel"] is not list:
elif not isinstance(resp["result"]["hotel"], list):
resp["result"]["hotel"] = [resp["result"]["hotel"]]

for hotel in resp["result"]["hotel"]:
Expand All @@ -107,5 +107,5 @@ def refine_getHotelList(resp: dict) -> dict:
def ensure_list_value(hotel: dict, parent_fld: str, child_fld: str) -> None:
if parent_fld not in hotel:
hotel[parent_fld] = {child_fld: []}
elif hotel[parent_fld][child_fld] is not list:
elif not isinstance(hotel[parent_fld][child_fld], list):
hotel[parent_fld][child_fld] = [hotel[parent_fld][child_fld]]

0 comments on commit 492b91a

Please sign in to comment.