Skip to content

Commit

Permalink
Merge branch 'main' into mle-plone-host
Browse files Browse the repository at this point in the history
  • Loading branch information
ericof authored Feb 4, 2025
2 parents be9c272 + 58f3f47 commit 404c41b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.7", "3.8", "3.9", "3.10"]
python: ["3.8", "3.9", "3.10"]
plone: ["6.0-latest", "5.2-latest"]
exclude:
- plone: "5.2-latest"
python: "3.9"
- plone: "5.2-latest"
python: "3.10"
- plone: "6.0-latest"
python: "3.7"
python: "3.8"
- plone: "6.0-latest"
python: "3.9"

steps:
# git checkout
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

- Add support for multiple plone sites on one installation via PLONE_BACKEND_HOST @maethu

- [Issue #118](https://github.com/collective/collective.elasticsearch/issues/118) Fix **ComponentLookupError** when adding a Plone Site (6.1) (@andreclimaco)


## 5.0.0 (2022-10-11)

Expand Down
5 changes: 3 additions & 2 deletions src/collective/elasticsearch/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from zope.component import getMultiAdapter
from zope.globalrequest import getRequest
from zope.interface import implementer
from zope.interface.interfaces import ComponentLookupError
from ZTUtils.Lazy import LazyMap

import os
Expand All @@ -41,7 +42,7 @@ def raise_search_exception(self):
value = api.portal.get_registry_record(
"raise_search_exception", interfaces.IElasticSettings, False
)
except KeyError:
except (KeyError, ComponentLookupError):
value = False
return value

Expand Down Expand Up @@ -118,7 +119,7 @@ def enabled(self):
value = api.portal.get_registry_record(
"enabled", interfaces.IElasticSettings, False
)
except KeyError:
except (KeyError, ComponentLookupError):
value = False
return value

Expand Down
1 change: 1 addition & 0 deletions src/collective/elasticsearch/redis/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def bulk_update(hosts, params, index_name, body, plone_url):
return "Done"



@job(queue_low, connection=queue_low.connection)
def update_file_data(hosts, params, index_name, body, plone_url):
"""
Expand Down
2 changes: 1 addition & 1 deletion src/collective/elasticsearch/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def get_brain_from_path(zcatalog: ZCatalog, path: str) -> AbstractCatalogBrain:

def get_settings():
"""Return IElasticSettings values."""
registry = getUtility(IRegistry)
try:
registry = getUtility(IRegistry)
settings = registry.forInterface(IElasticSettings, check=False)
except Exception: # noQA
settings = None
Expand Down

0 comments on commit 404c41b

Please sign in to comment.