Skip to content

Commit

Permalink
fixed check
Browse files Browse the repository at this point in the history
  • Loading branch information
RedTurtle committed Dec 9, 2024
1 parent b91e480 commit d9af179
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/design/plone/contenttypes/upgrades/to_7001.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions src/design/plone/contenttypes/upgrades/upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit d9af179

Please sign in to comment.