From 21d3809d0112e496a22094e6cfc7272196655813 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Wed, 1 Oct 2014 17:14:15 +0100 Subject: [PATCH] python3 fix for ElasticSearch backend error message --- wagtail/wagtailsearch/backends/elasticsearch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wagtail/wagtailsearch/backends/elasticsearch.py b/wagtail/wagtailsearch/backends/elasticsearch.py index 2f392cf18..80830827a 100644 --- a/wagtail/wagtailsearch/backends/elasticsearch.py +++ b/wagtail/wagtailsearch/backends/elasticsearch.py @@ -3,6 +3,7 @@ from __future__ import absolute_import import json from six.moves.urllib.parse import urlparse +from six import text_type from django.db import models from django.db.models.sql.where import SubqueryConstraint, WhereNode @@ -210,7 +211,7 @@ class ElasticSearchQuery(object): } } - raise FilterError('Could not apply filter on ElasticSearch results: "' + field_attname + '__' + lookup + ' = ' + unicode(value) + '". Lookup "' + lookup + '"" not recognised.') + raise FilterError('Could not apply filter on ElasticSearch results: "' + field_attname + '__' + lookup + ' = ' + text_type(value) + '". Lookup "' + lookup + '"" not recognised.') def _get_filters_from_where(self, where_node): # Check if this is a leaf node