Skip to content

Commit

Permalink
update list of non searchable types in io-Comune (#59)
Browse files Browse the repository at this point in the history
* update list of non searchable types in io-Comune
  • Loading branch information
luca-bellenghi authored Dec 11, 2023
1 parent e6b6b10 commit fc2201b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
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
10 changes: 9 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,7 +78,11 @@ def disable_searchable_types():
"Discussion Item",
"Dataset",
"Documento Personale",
"File",
"Image",
"Incarico",
"Messaggio",
"Modulo",
"Pratica",
"RicevutaPagamento",
]
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>

0 comments on commit fc2201b

Please sign in to comment.