diff --git a/src/iosanita/contenttypes/adapters/schema_tweaks.py b/src/iosanita/contenttypes/adapters/schema_tweaks.py index 9e807d1..39f223d 100644 --- a/src/iosanita/contenttypes/adapters/schema_tweaks.py +++ b/src/iosanita/contenttypes/adapters/schema_tweaks.py @@ -12,9 +12,7 @@ @implementer(ISchemaPlugin) @adapter(IFormFieldProvider) class SchemaTweaks(object): - """ - Fix fields for content-types to be like v2 of design.plone.contenttypes - """ + """ """ order = 99999 @@ -34,8 +32,11 @@ def set_description_required(self): def fix_bando(self): """fix Bando fields""" - IBandoSchema["destinatari"].required = False - IBandoSchema.setTaggedValue( - OMITTED_KEY, - [(Interface, "destinatari", "true")], - ) + if self.schema.getName() == "IBando": + # set it only once + IBandoSchema["destinatari"].required = False + IBandoSchema["scadenza_bando"].required = True + IBandoSchema.setTaggedValue( + OMITTED_KEY, + [(Interface, "destinatari", "true")], + )