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

update persona with new fields for trasparenza #275

Merged
merged 2 commits into from
Sep 3, 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
5 changes: 3 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ Changelog
6.2.15 (unreleased)
-------------------

- Nothing changed yet.

- Add "Emolumenti a carico della finanza pubblica" to Persona
Add "Dichiarazioni di insussistenza e incompatibilità" to Persona
[lucabel]

6.2.14 (2024-07-11)
-------------------
Expand Down
24 changes: 23 additions & 1 deletion src/design/plone/contenttypes/interfaces/persona.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,24 @@ class IPersona(model.Schema, IDesignPloneContentType):
),
)

emolumenti_a_carico_della_finanza_pubblica = field.NamedBlobFile(
title=_(
"emolumenti_a_carico_della_finanza_pubblica_label",
default="Emolumenti a carico della finanza pubblica",
),
required=False,
description="",
)

dichiarazioni_di_insussistenza_e_incompatibilita = field.NamedBlobFile(
title=_(
"dichiarazioni_di_insussistenza_e_incompatibilita_label",
default="Dichiarazioni di insussistenza e incompatibilità",
),
required=False,
description="",
)

# custom widgets
form.widget(
"organizzazione_riferimento",
Expand Down Expand Up @@ -144,7 +162,11 @@ class IPersona(model.Schema, IDesignPloneContentType):
model.fieldset(
"documenti",
label=_("documenti_label", default="Documenti"),
fields=["curriculum_vitae"],
fields=[
"curriculum_vitae",
"emolumenti_a_carico_della_finanza_pubblica",
"dichiarazioni_di_insussistenza_e_incompatibilita",
],
)

# SearchableText fields
Expand Down
9 changes: 8 additions & 1 deletion src/design/plone/contenttypes/tests/test_ct_persona.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,14 @@ def test_persona_fields_documenti_fieldset(self):
Get the list from restapi
"""
resp = self.api_session.get("@types/Persona").json()
self.assertEqual(resp["fieldsets"][3]["fields"], ["curriculum_vitae"])
self.assertEqual(
resp["fieldsets"][3]["fields"],
[
"curriculum_vitae",
"emolumenti_a_carico_della_finanza_pubblica",
"dichiarazioni_di_insussistenza_e_incompatibilita",
],
)

def test_persona_fields_informazioni_fieldset(self):
"""
Expand Down
Loading