Commit 57454bff authored by Sli's avatar Sli Committed by Skia

forum: workaround size error while building index, handle malformed utf8

parent 641d564e
...@@ -99,7 +99,9 @@ class BigCharFieldIndex(indexes.CharField): ...@@ -99,7 +99,9 @@ class BigCharFieldIndex(indexes.CharField):
""" """
def prepare(self, term): def prepare(self, term):
return super(BigCharFieldIndex, self).prepare(term)[:240] return bytes(super(BigCharFieldIndex, self).prepare(term), "utf-8")[
:245
].decode("utf-8", errors="ignore")
class ForumMessageIndex(indexes.SearchIndex, indexes.Indexable): class ForumMessageIndex(indexes.SearchIndex, indexes.Indexable):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment