from collective.ftw.upgrade import UpgradeStep
from plone import api
from plone.base.utils import get_installer


class InstallTheImageBankApp(UpgradeStep):
    """Install the Image bank app."""

    def __call__(self):
        installer = get_installer(api.portal.get())
        if not installer.is_product_installed("ploneintranet.imagebank"):
            installer.install_product("ploneintranet.imagebank")
