senaite / senaite.core

Enterprise Open Source Laboratory System (LIMS)
https://senaite.com
GNU General Public License v2.0
254 stars 145 forks source link

Fix traceback when applying referencebehavior to non DX types #2579

Closed xispa closed 4 months ago

xispa commented 4 months ago

Description of the issue/feature this PR addresses

This Pull Request fixes a Traceback that occurs when running the upgrade step 2636 (#2578) with an add-on installed that contains non-dexterity types inside setup folder.

Current behavior before PR

Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 176, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 385, in publish_module
  Module ZPublisher.WSGIPublisher, line 288, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 63, in call_object
  Module Products.CMFPlone.controlpanel.browser.quickinstaller, line 666, in __call__
  Module Products.CMFPlone.controlpanel.browser.quickinstaller, line 399, in upgrade_product
  Module Products.GenericSetup.tool, line 1202, in upgradeProfile
  Module Products.GenericSetup.upgrade, line 185, in doStep
  Module senaite.core.upgrade.v02_06_000, line 1851, in set_referenceable_behavior
AttributeError: 'RequestContainer' object has no attribute 'behaviors'

Desired behavior after PR is merged

Upgrade step finishes without complains

-- I confirm I have tested this PR thoroughly and coded it according to PEP8 and Plone's Python styleguide standards.