From 090a1c809582368d208832375fe9216c5356b6ca Mon Sep 17 00:00:00 2001 From: Andrea Cecchi Date: Tue, 21 Nov 2023 16:30:26 +0100 Subject: [PATCH] Do not return section children in @search-filters endpoint if they are types omitted from search results --- src/design/plone/policy/restapi/search_filters/get.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/design/plone/policy/restapi/search_filters/get.py b/src/design/plone/policy/restapi/search_filters/get.py index c0cc5e1..ecb7756 100644 --- a/src/design/plone/policy/restapi/search_filters/get.py +++ b/src/design/plone/policy/restapi/search_filters/get.py @@ -38,12 +38,8 @@ def get_portal_types(self): return sorted(types, key=lambda k: k["label"]) def reply(self): - settings = ( - api.portal.get_registry_record( - "search_sections", - interface=IDesignPloneSettings, - ) - or "[]" + settings = api.portal.get_registry_record( + "search_sections", interface=IDesignPloneSettings, default="[]" ) utils = getToolByName(self.context, "plone_utils")