Skip to content

Commit

Permalink
Workaround for empty contacts UO summaryserializer (#279)
Browse files Browse the repository at this point in the history
Co-authored-by: plone@caligola <plone@caligola>
  • Loading branch information
mamico and plone@caligola authored Sep 20, 2024
1 parent 316df34 commit b1ed59c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Changelog
6.2.15 (2024-09-04)
-------------------

- Workaround for empty contacts UO summaryserializer
[mamico]
- Add design.plone.contenttypes.behavior.news_base behavior (news metadata, without blocks)
[mamico]
- Add folder creation (multimedia + allegati) for "ComunicatiStampa" CT (if exists)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@ def __call__(self, force_images=True, **kwargs):
"contact_info",
"sede",
]

for field in fields:
if field in ("contact_info", "sede"):
data[field] = json_compatible(getattr(self.context, field, ""))
# XXX: in realta' qui andrebbe usato il serializer specifico per
# i field relationfield, questo però richiede recuperare il
# il field e il suo serializeadpater, al momento aggiungiamo
# solo un controllo su relazioni non trovate
values = getattr(self.context, field, []) or []
data[field] = [val for val in json_compatible(values) if val]
else:
data[field] = getattr(self.context, field, "")

Expand Down

0 comments on commit b1ed59c

Please sign in to comment.