Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 7306 upgrade step #269

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Changelog

- Set `file_principale` field as primary, so we call @@download on the content, that file will be downloaded automatically.
[cekk]
- Fix `to_7306`` upgrade-step to be more specific on types configuration.
[cekk]
- Override listing.pt from plone.app.contenttypes due to error rendering event
[lucabel]

Expand Down
14 changes: 12 additions & 2 deletions src/design/plone/contenttypes/upgrades/to_730x.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,15 @@ def to_7305(context):


def to_7306(context):
logger.info("Disallow add other objs in Persona and Incarico ct")
update_types(context)
logger.info("Enable plone.constraintypes behavior and filter types")

portal_types = api.portal.get_tool(name="portal_types")
behavior = "plone.constraintypes"
for ct in ["Persona", "Incarico"]:
portal_type = portal_types.get(ct, None)
if portal_type:
portal_type.filter_content_types = True
behaviors = list(portal_type.behaviors)
if behavior not in behaviors:
behaviors.append(behavior)
portal_type.behaviors = tuple(behaviors)
Loading