from Acquisition import aq_inner
from Acquisition import aq_parent
from Products.CMFCore.utils import getToolByName


def upgrade(tool):
    """ Enable portlets for key=/ (re-import portlets.xml): issue #695
    """
    portal = aq_parent(aq_inner(tool))
    setup = portal.portal_setup

    setup.runImportStepFromProfile('profile-bika.lims:default', 'portlets')

from Acquisition import aq_inner
from Acquisition import aq_parent
from Products.CMFCore.utils import getToolByName


def upgrade(tool):
    """ Enable portlets for key=/ (re-import portlets.xml): issue #695
    """
    portal = aq_parent(aq_inner(tool))
    setup = portal.portal_setup

    setup.runImportStepFromProfile('profile-bika.lims:default', 'portlets',
                                   run_dependencies=False)

Upgrade 1117 - add run_dependencies=False
Upgrade 1117 - add run_dependencies=False

Somehow re-importing the 'portlets' step, causes
a beforeDelete handler to fail a HoldingReference
check.

  from Acquisition import aq_inner
  from Acquisition import aq_parent
  from Products.CMFCore.utils import getToolByName
  
  
  def upgrade(tool):
      """ Enable portlets for key=/ (re-import portlets.xml): issue #695
      """
      portal = aq_parent(aq_inner(tool))
      setup = portal.portal_setup
  
-     setup.runImportStepFromProfile('profile-bika.lims:default', 'portlets')
+     setup.runImportStepFromProfile('profile-bika.lims:default', 'portlets',
+                                    run_dependencies=False)
  
Upgrade 1117 - add run_dependencies=False
## Code Before:
from Acquisition import aq_inner
from Acquisition import aq_parent
from Products.CMFCore.utils import getToolByName


def upgrade(tool):
    """ Enable portlets for key=/ (re-import portlets.xml): issue #695
    """
    portal = aq_parent(aq_inner(tool))
    setup = portal.portal_setup

    setup.runImportStepFromProfile('profile-bika.lims:default', 'portlets')

## Instruction:
Upgrade 1117 - add run_dependencies=False
## Code After:
from Acquisition import aq_inner
from Acquisition import aq_parent
from Products.CMFCore.utils import getToolByName


def upgrade(tool):
    """ Enable portlets for key=/ (re-import portlets.xml): issue #695
    """
    portal = aq_parent(aq_inner(tool))
    setup = portal.portal_setup

    setup.runImportStepFromProfile('profile-bika.lims:default', 'portlets',
                                   run_dependencies=False)
