Skip to content

Commit b773c6a

Browse files
Fixed upgrade steps for Persona CT to prevent breakage due to ConstrainTypes restrictions
1 parent ffb5abb commit b773c6a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Changelog
44
6.3.6 (unreleased)
55
------------------
66

7-
- Nothing changed yet.
7+
- Fixed upgrade steps for Persona CT to prevent breakage due to ConstrainTypes restrictions
8+
[lucabel]
89

910

1011
6.3.5 (2025-04-02)

src/design/plone/contenttypes/upgrades/to_730x.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ def to_7314(context):
253253
brains = pc(portal_type="Persona")
254254
for brain in brains:
255255
persona = brain.getObject()
256+
actual_contraints = ISelectableConstrainTypes(persona)
257+
actual_constrain_type = actual_contraints.getConstrainTypesMode()
258+
# devo poter aggiungere
259+
actual_contraints.setConstrainTypesMode(0)
256260
if (
257261
"dichiarazione-insussistenza-cause-di-inconferibilita-e-incompatibilita"
258262
not in persona.keys()
@@ -265,3 +269,5 @@ def to_7314(context):
265269
):
266270
createStructure(persona, mapping2)
267271
logger.info("Add emolumenti complessivi for {}".format(persona.title))
272+
# reimposto il valore precedente del constraintypes
273+
actual_contraints.setConstrainTypesMode(actual_constrain_type)

0 commit comments

Comments
 (0)