# HG changeset patch # User Thierry Florac # Date 1540537207 -7200 # Node ID e22f30b4ef3a7d6e85cb802544648845cbe76642 # Parent d2485124991c57a25950ac17f79a0b365047021a Check context before extracting content type diff -r d2485124991c -r e22f30b4ef3a src/pyams_content/shared/view/__init__.py --- a/src/pyams_content/shared/view/__init__.py Fri Oct 26 08:59:12 2018 +0200 +++ b/src/pyams_content/shared/view/__init__.py Fri Oct 26 09:00:07 2018 +0200 @@ -32,7 +32,8 @@ from pyams_catalog.query import CatalogResultSet, or_ from pyams_content.features.preview.interfaces import IPreviewTarget from pyams_content.features.review.interfaces import IReviewTarget -from pyams_content.shared.common import WfSharedContent, register_content_type, SharedContent, IWfSharedContentFactory +from pyams_content.shared.common import WfSharedContent, register_content_type, SharedContent, IWfSharedContentFactory, \ + IWfSharedContent from pyams_content.shared.common.interfaces.types import IWfTypedSharedContent from pyams_content.shared.view.interfaces import IView, IWfView, IWfViewFactory, IViewQuery, \ IViewQueryParamsExtension, IViewQueryFilterExtension, VIEW_CONTENT_TYPE, VIEW_CONTENT_NAME, IViewSettings @@ -86,7 +87,7 @@ def get_content_types(self, context): content_types = set() - if self.select_context_type: + if self.select_context_type and IWfSharedContent.providedBy(context): content_types.add(context.content_type) if self.selected_content_types: content_types |= set(self.selected_content_types)