Skip to content

Commit

Permalink
Fix search for uncached entries (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
chubin committed Apr 18, 2022
1 parent 717f89e commit 742dd9f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ def find_answers_by_keyword(directory, keyword, options="", request_options=None
answer_dicts = get_answers(topic, request_options=request_options)
for answer_dict in answer_dicts:
answer_text = answer_dict.get('answer', '')
# Temporary hotfix:
# In some cases answer_text may be 'bytes' and not 'str'
if type(b"") == type(answer_text):
answer_text = answer_text.decode("utf-8")

if match(answer_text, keyword, options_dict=options_dict):
answers_found.append(answer_dict)

Expand Down

0 comments on commit 742dd9f

Please sign in to comment.