changeset 7958:e2b9731cb2fb

search: fix "'' is not unicode" when searching for wildcards Seen when search matches on an empty list of unicode matches and the joining '' thus isn't coerced to u'' - seen for example on http://localhost:5000/_admin/search?q=*a*&type=content .
author Mads Kiilerich <mads@kiilerich.com>
date Sat, 09 Nov 2019 19:13:41 +0100
parents eee49a119592
children 552f6738ace2
files kallithea/lib/indexers/__init__.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/indexers/__init__.py	Mon Nov 04 08:00:01 2019 +0100
+++ b/kallithea/lib/indexers/__init__.py	Sat Nov 09 19:13:41 2019 +0100
@@ -203,8 +203,7 @@
         return res
 
     def get_short_content(self, res, chunks):
-
-        return ''.join([res['content'][chunk[0]:chunk[1]] for chunk in chunks])
+        return u''.join([res['content'][chunk[0]:chunk[1]] for chunk in chunks])
 
     def get_chunks(self):
         """