# HG changeset patch # User Thierry Florac # Date 1550231853 -3600 # Node ID 50e2d69f3ac7b4dab2ca0b8326da46d70ce4e091 # Parent e4619912623dd1ed44cf4531967f7107e3debafd Reject "ignored" shared content types from views and search folders diff -r e4619912623d -r 50e2d69f3ac7 src/pyams_content_es/shared/view/__init__.py --- a/src/pyams_content_es/shared/view/__init__.py Fri Jan 18 15:43:08 2019 +0100 +++ b/src/pyams_content_es/shared/view/__init__.py Fri Feb 15 12:57:33 2019 +0100 @@ -20,6 +20,7 @@ from pyams_catalog.query import CatalogResultSet from pyams_content.features.search import ISearchFolder +from pyams_content.shared.common import IGNORED_CONTENT_TYPES from pyams_content.shared.view.interfaces import IViewQuery, \ IViewQueryEsParamsExtension, IViewQueryFilterExtension, IViewUserQuery, IWfView, RELEVANCE_ORDER from pyams_content.shared.view.portlet import SEARCH_EXCLUDED_ITEMS @@ -62,6 +63,7 @@ if content_path is not None: params &= Q('term', **{'parent_ids': content_path}) # check content types + params &= Q('bool', must_not=Q('terms', **{'content_type': tuple(IGNORED_CONTENT_TYPES.keys())})) content_types = view.get_content_types(context) if content_types: params &= Q('terms', **{'content_type': content_types})