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

Missing dependency - plone.app.contenttypes #10

Open
djowett opened this issue Nov 8, 2016 · 2 comments
Open

Missing dependency - plone.app.contenttypes #10

djowett opened this issue Nov 8, 2016 · 2 comments

Comments

@djowett
Copy link

djowett commented Nov 8, 2016

Shouldn't this be a dependency in setup.py? Without it I get an error on vanilla Plone 4.3.11

 ImportError: No module named contenttypes.behaviors.leadimage
@djowett
Copy link
Author

djowett commented Nov 8, 2016

Or (perhaps more likely) this product should cope with leadimage behavior being absent

@rnixx
Copy link
Member

rnixx commented Nov 9, 2016

Yes leadimage should be optional. A view uses it if available, thus this can be solved like so:

from zope.interface import Interface
try:
    from plone.app.contenttypes.behaviors.leadimage import ILeadImage
except ImportError:
    class ILeadImage(Interface):
        """Dummy lead image interface if plone.app.contenttypes missing"""

feel free to open a PR :)

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

No branches or pull requests

2 participants