Skip to content

Commit

Permalink
Fixes unicode error in Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
seitenbau-govdata committed Jul 14, 2022
1 parent 7b6097a commit a38d5e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckanext/harvest/plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
import json
import six
from logging import getLogger

from six import string_types
Expand Down Expand Up @@ -110,7 +111,7 @@ def before_dataset_search(self, search_params):

fq = search_params.get("fq", "")
if "dataset_type:harvest" not in fq:
fq = "{0} -dataset_type:harvest".format(search_params.get("fq", ""))
fq = "{0} -dataset_type:harvest".format(fq.encode('utf8') if six.PY2 else fq)
search_params.update({"fq": fq})

return search_params
Expand Down

0 comments on commit a38d5e9

Please sign in to comment.