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

plone.constraintypes breaks when the parent as no portal type #319

Closed
ale-rt opened this issue Dec 12, 2020 · 0 comments · Fixed by #320
Closed

plone.constraintypes breaks when the parent as no portal type #319

ale-rt opened this issue Dec 12, 2020 · 0 comments · Fixed by #320

Comments

@ale-rt
Copy link
Member

ale-rt commented Dec 12, 2020

I found this when working on plone/Products.CMFPlone#2454:

  File "/home/ale/.buildout/eggs/plone.app.dexterity-2.6.8-py3.8.egg/plone/app/dexterity/behaviors/constrains.py", line 30, in getConstrainTypesMode
    if not self.context.portal_type == parent.portal_type:
AttributeError: 'RequestContainer' object has no attribute 'portal_type'

I would say:

  1. we should not lookup portal_type in an acquired object
  2. we should use getattr to check for the portal type
ale-rt added a commit that referenced this issue Dec 12, 2020
Fix the constraint types mode calculation, disabling acquisition and gracefully checking for the existence of a portal type attribute in the container

Fixes #319
ale-rt added a commit that referenced this issue Dec 12, 2020
* Fix the constraint types mode calculation

Fix the constraint types mode calculation, disabling acquisition and gracefully checking for the existence of a portal type attribute in the container
Add test coverage and cleanup unused imports

Fixes #319

Co-authored-by: Roel Bruggink <roel@jaroel.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant