Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return Bando.apertura_bando as null if had been set default(1100-01-0… #281

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading