Skip to content

Commit

Permalink
fix msg
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed Mar 26, 2024
1 parent 627bb45 commit 76ce6ac
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/rer/solrpush/utils/solr_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from rer.solrpush.utils.solr_common import get_solr_connection
from rer.solrpush.utils.solr_common import get_setting
from rer.solrpush.utils.solr_common import get_index_fields
from rer.solrpush.utils.solr_common import is_solr_active
from rer.solrpush.interfaces.settings import IRerSolrpushSettings
from rer.solrpush.utils.solr_indexer import parse_date_str
from DateTime import DateTime
Expand Down Expand Up @@ -276,6 +277,7 @@ def add_query_tweaks():

# END HELPER METHODS


# LIBRARY METHODS
def search(
query,
Expand All @@ -298,8 +300,10 @@ def search(
"""
solr = get_solr_connection()
if not solr:
msg = u"Unable to search using solr. Configuration is incomplete."
logger.error(msg)
msg = "Unable to search using solr. Configuration is incomplete."
if is_solr_active():
# log it beacuse it's misconfigured
logger.error(msg)
return {
"error": True,
"message": translate(
Expand All @@ -324,9 +328,9 @@ def search(
"message": translate(
_(
"search_error_label",
default=u"Unable to perform a search with SOLR."
u" Please contact the site administrator or wait some"
u" minutes.",
default="Unable to perform a search with SOLR."
" Please contact the site administrator or wait some"
" minutes.",
),
context=api.portal.get().REQUEST,
),
Expand Down

0 comments on commit 76ce6ac

Please sign in to comment.