Skip to content

Commit

Permalink
make bando field required
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed Sep 17, 2024
1 parent 5776599 commit dd168e6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/iosanita/contenttypes/adapters/schema_tweaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")],
)

0 comments on commit dd168e6

Please sign in to comment.