mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 06:03:20 +00:00
forum: workaround size error while building index, handle malformed utf8
This commit is contained in:
parent
641d564ec6
commit
57454bffa0
@ -99,7 +99,9 @@ class BigCharFieldIndex(indexes.CharField):
|
||||
"""
|
||||
|
||||
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):
|
||||
|
Loading…
Reference in New Issue
Block a user