Skip to content

Commit

Permalink
handle also old-style persona folders
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed Mar 5, 2024
1 parent 2548d84 commit 681e614
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion src/design/plone/contenttypes/upgrades/upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,37 @@ def to_7200(context):
if i % 100 == 0:
logger.info("Progress: {}/{}".format(i, tot))
container = brain.getObject()
for mapping in SUBFOLDERS_MAPPING.get(container.portal_type, []):
mappings = SUBFOLDERS_MAPPING.get(container.portal_type, [])
persona_old_mapping = [
{
"id": "foto-e-attivita-politica",
},
{"id": "curriculum-vitae"},
{"id": "compensi"},
{
"id": "importi-di-viaggio-e-o-servizi",
},
{
"id": "situazione-patrimoniale",
},
{
"id": "dichiarazione-dei-redditi",
},
{
"id": "spese-elettorali",
},
{
"id": "variazione-situazione-patrimoniale",
},
{
"id": "altre-cariche",
},
]
if container.portal_type == "Persona":
# cleanup also some old-style (v2) folders
mappings.extend(persona_old_mapping)

for mapping in mappings:
child = container.get(mapping["id"], None)
if not child:
continue
Expand Down

0 comments on commit 681e614

Please sign in to comment.