Skip to content

Commit

Permalink
Merge pull request #379 from collective/fix_isActive_ticket_378
Browse files Browse the repository at this point in the history
Fix creating a fresh site in Plone 6.1 when registry does not exist yes
  • Loading branch information
davisagli authored Sep 21, 2024
2 parents 9abd14f + cc05ba0 commit e713cf5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ Changelog
9.3.1 (unreleased)
------------------

- Nothing changed yet.

- Fix creating a fresh site in Plone 6.1 when registry does not exist yet. Fixes #378 [pbauer]

9.3.0 (2024-02-15)
------------------
Expand Down
7 changes: 5 additions & 2 deletions src/collective/solr/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from six.moves import range
from unidecode import unidecode
from zope.component import getUtility
from zope.component import queryUtility

if hasattr(str, "maketrans"):
maketrans = str.maketrans
Expand All @@ -22,7 +23,9 @@ def getConfig():
def isActive():
"""indicate if the solr connection should/can be used"""
try:
registry = getUtility(IRegistry)
registry = queryUtility(IRegistry)
if registry is None:
return False
active = registry["collective.solr.active"]
except KeyError:
return False
Expand Down Expand Up @@ -132,7 +135,7 @@ def isSimpleSearch(term):
new_parts.append(parts[i])
else:
new_parts.append("quoted")
term = u"".join(new_parts)
term = "".join(new_parts)
if bool(operators.match(term)):
return False
if bool(simpleCharacters.match(term)):
Expand Down

0 comments on commit e713cf5

Please sign in to comment.