Skip to content

Commit

Permalink
update list of non searchable types in io-Comune
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-bellenghi committed Dec 1, 2023
1 parent e6b6b10 commit e94884c
Show file tree
Hide file tree
Showing 4 changed files with 24 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
12 changes: 11 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,14 @@ def disable_searchable_types():
"Discussion Item",
"Dataset",
"Documento Personale",
"File",
"Image",
"Incarico",
"LRF",
"Messaggio",
"Modulo",
"Pratica",
"PuntoDiContatto",
"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>

0 comments on commit e94884c

Please sign in to comment.