diff --git a/CHANGES.rst b/CHANGES.rst index f48cb1c5..797e533f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,8 @@ Changelog 6.1.4 (unreleased) ------------------ -- Nothing changed yet. +- Fix check_persone. When there are no relation. + [mamico] 6.1.3 (2023-11-28) diff --git a/src/design/plone/contenttypes/browser/utils/check_persone.py b/src/design/plone/contenttypes/browser/utils/check_persone.py index fff003d5..9298c8a8 100644 --- a/src/design/plone/contenttypes/browser/utils/check_persone.py +++ b/src/design/plone/contenttypes/browser/utils/check_persone.py @@ -70,14 +70,15 @@ def information_dict(self, persona): if persona.incarichi_persona: relations = self.get_related_objects(persona, "incarichi_persona") - rel_data = relations[0] - - if ( - rel_data["data_inizio_incarico"] - and rel_data["title"].strip() - and rel_data["tipologia_incarico"] - ): - incarichi_persona = FLAG + if relations: + rel_data = relations[0] + + if ( + rel_data["data_inizio_incarico"] + and rel_data["title"].strip() + and rel_data["tipologia_incarico"] + ): + incarichi_persona = FLAG return { "incarichi_persona": incarichi_persona,