Skip to content

Commit

Permalink
Return Bando.apertura_bando as null if had been set default(1100-01-0…
Browse files Browse the repository at this point in the history
…1T00:00:00). (#281)

Co-authored-by: Roman Kysil <[email protected]>
  • Loading branch information
folix-01 and Roman Kysil authored Sep 20, 2024
1 parent d05edf7 commit 5f527be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Changelog
5.1.16 (unreleased)
-------------------

- Nothing changed yet.

- Return Bando.apertura_bando as null if had been set default("1100-01-01T00:00:00").
[folix-01]

5.1.15 (2024-09-16)
-------------------
Expand Down
8 changes: 8 additions & 0 deletions src/design/plone/contenttypes/restapi/serializers/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ def __call__(self, force_all_metadata=False):
if "bando_state" in metadata_fields or self.show_all_metadata_fields:
res["bando_state"] = self.get_bando_state()

# if default set to None
if (
"apertura_bando" in metadata_fields
or self.show_all_metadata_fields
and res["apertura_bando"] == "1100-01-01T00:00:00"
):
res["apertura_bando"] = None

if "geolocation" in metadata_fields or self.show_all_metadata_fields:
# backward compatibility for some block templates
if "geolocation" not in res:
Expand Down

0 comments on commit 5f527be

Please sign in to comment.