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

update list of non searchable types in io-Comune #59

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changelog
5.0.7 (unreleased)
------------------

- Update list of non searchable type in io-Comune
[lucabel]
- Do not return section children in @search-filters endpoint if they are types omitted from search results.
[cekk]

Expand Down
2 changes: 1 addition & 1 deletion src/design/plone/policy/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<version>3102</version>
<version>3103</version>
<dependencies>
<dependency>profile-plone.restapi:default</dependency>
<dependency>profile-design.plone.contenttypes:default</dependency>
Expand Down
11 changes: 10 additions & 1 deletion src/design/plone/policy/setuphandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ def post_install(context):
create_secondary_menu()


def disable_searchable_types():
def disable_searchable_types(context=None):
# remove some types from search enabled ones

# This is the list updated at 2023/12/01 with all types that
# could not be searchable in io-Comune

registry = getUtility(IRegistry)
settings = registry.forInterface(ISearchSchema, prefix="plone")
remove_types = [
Expand All @@ -74,8 +78,13 @@ def disable_searchable_types():
"Discussion Item",
"Dataset",
"Documento Personale",
"File",
"Image",
"Incarico",
"Messaggio",
"Modulo",
"Pratica",
"PuntoDiContatto",
luca-bellenghi marked this conversation as resolved.
Show resolved Hide resolved
"RicevutaPagamento",
]
types = set(settings.types_not_searched)
Expand Down
10 changes: 10 additions & 0 deletions src/design/plone/policy/upgrades.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,14 @@
handler=".upgrades.update_registry"
/>
</genericsetup:upgradeSteps>
<genericsetup:upgradeSteps
profile="design.plone.policy:default"
source="3102"
destination="3103"
>
<genericsetup:upgradeStep
title="Update not searchable types in io-Comune site"
handler=".setuphandlers.disable_searchable_types"
/>
</genericsetup:upgradeSteps>
</configure>
Loading