diff --git a/CHANGES.rst b/CHANGES.rst index 3605c138..3d4c2997 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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) ------------------- diff --git a/src/design/plone/contenttypes/restapi/serializers/summary.py b/src/design/plone/contenttypes/restapi/serializers/summary.py index 4d326f6b..bb5a1e94 100644 --- a/src/design/plone/contenttypes/restapi/serializers/summary.py +++ b/src/design/plone/contenttypes/restapi/serializers/summary.py @@ -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: