Skip to content

Commit

Permalink
workaround for empty contact
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico committed Sep 12, 2024
1 parent e392f85 commit 38b7f88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Changelog
2.7.8 (unreleased)
------------------

- Nothing changed yet.
- Workaround for empty contacts
[mamico]


2.7.7 (2024-08-22)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ def __call__(self, *args, **kwargs):
for i in self.context.get_booking_types()
]

# Questo è un workaround per gesitire il caso in cui ci siano uffici correlati con contatti vuoti
if res.get("uffici_correlati"):
for ufficio in res["uffici_correlati"]:
ufficio["contact_info"] = [contact for contact in ufficio.get("contact_info") or [] if contact]

return res

0 comments on commit 38b7f88

Please sign in to comment.