diff --git a/src/design/plone/contenttypes/upgrades/to_7001.py b/src/design/plone/contenttypes/upgrades/to_7001.py index 9d56428c..13a10b39 100644 --- a/src/design/plone/contenttypes/upgrades/to_7001.py +++ b/src/design/plone/contenttypes/upgrades/to_7001.py @@ -300,7 +300,7 @@ def migrated_contact_info(source): continue if not migrated_contact_info(obj): - if hasattr(aq_base(obj), "contact_info"): + if getattr(aq_base(obj), "contact_info"): obj.old_contact_info = obj.contact_info if obj.portal_type == "UnitaOrganizzativa": del obj.contact_info diff --git a/src/design/plone/contenttypes/upgrades/upgrades.py b/src/design/plone/contenttypes/upgrades/upgrades.py index f7bf4949..8bfabb2e 100644 --- a/src/design/plone/contenttypes/upgrades/upgrades.py +++ b/src/design/plone/contenttypes/upgrades/upgrades.py @@ -1415,12 +1415,15 @@ def update_folder_for_gallery(self): pc = api.portal.get_tool(name="portal_catalog") for brain in pc(portal_type="Event"): evento = brain.getObject() - logger.info(f"{colors.DARKCYAN} Event: {evento.absolute_url()} {colors.ENDC}") if "multimedia" in evento.keys(): - renamed_event = api.content.rename(evento["multimedia"], new_id="immagini") - renamed_event.title = "Immagini" - renamed_event.reindexObject(idxs=["id", "title"]) + try: + renamed_event = api.content.rename(evento["multimedia"], new_id="immagini") + renamed_event.title = "Immagini" + renamed_event.reindexObject(idxs=["id", "title"]) + except: + import pdb;pdb.set_trace() + logger.info(f"{colors.GREEN} Rename multimedia {colors.ENDC}") if "video" not in evento.keys():