Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico committed Jul 25, 2024
1 parent 2fa8a6f commit e129a0e
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/rer/ufficiostampa/setuphandlers.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from Products.CMFPlone.interfaces import INonInstallable
from zope.interface import implementer
from plone import api
from plone.dexterity.interfaces import IDexterityFTI
from Products.CMFPlone.interfaces import INonInstallable
from Products.CMFPlone.utils import get_installer
Crom plone.dexterity.interfaces import IDexterityFTI
from zope.component import getUtility
from zope.interface import implementer


def set_behavior(fti_id, name, value):
"""Set a behavior on a FTI
if value is True, add the behavior, otherwise remove it
"""
if value is True, add the behavior, otherwise remove it
"""
# add or remove the behavior based on the value from the form
fti = getUtility(IDexterityFTI, name=fti_id)
behaviors = list(fti.behaviors)
Expand All @@ -34,11 +34,18 @@ def post_install(context):
# Do something during the installation of this package
installer = get_installer(context)
if installer.is_product_installed("design.plone.contenttypes"):
set_behavior("ComunicatoStampa", "design.plone.contenttypes.behavior.argomenti_news", True)
set_behavior("ComunicatoStampa", "design.plone.contenttypes.behavior.news_base", True)
set_behavior(
"ComunicatoStampa",
"design.plone.contenttypes.behavior.argomenti_news",
True,
)
set_behavior(
"ComunicatoStampa", "design.plone.contenttypes.behavior.news_base", True
)
set_behavior("ComunicatoStampa", "plone.basic", True)
set_behavior("ComunicatoStampa", "rer.ufficiostampa.basic", False)
set_behavior("ComunicatoStampa", "rer.ufficiostampa.legislature", False)


def uninstall(context):
"""Uninstall script"""

0 comments on commit e129a0e

Please sign in to comment.