summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas ROCHE <nroche@entrouvert.com>2021-07-12 14:51:37 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2021-07-13 09:24:39 (GMT)
commit36c0e69cb1b4ad48f0d6e6601b58d2f6b333abf4 (patch)
treea00298c5718328a4845a6be31c7f0aa64f70f872
parent7abee8882567758d2174d5bc49abcc26db4d6976 (diff)
downloadwelco-36c0e69cb1b4ad48f0d6e6601b58d2f6b333abf4.zip
welco-36c0e69cb1b4ad48f0d6e6601b58d2f6b333abf4.tar.gz
welco-36c0e69cb1b4ad48f0d6e6601b58d2f6b333abf4.tar.bz2
kb: use html.unescape (#55535)
-rw-r--r--welco/kb/search_indexes.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/welco/kb/search_indexes.py b/welco/kb/search_indexes.py
index ec24f70..5cbafed 100644
--- a/welco/kb/search_indexes.py
+++ b/welco/kb/search_indexes.py
@@ -14,8 +14,9 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import html
+
from django.utils.html import strip_tags
-from django.utils.six.moves.html_parser import HTMLParser
from haystack import indexes
@@ -33,7 +34,7 @@ class PageIndex(indexes.SearchIndex, indexes.Indexable):
return Page
def prepare_text(self, obj):
- return obj.title + ' ' + self.prepare_tags(obj) + ' ' + HTMLParser().unescape(strip_tags(obj.content))
+ return obj.title + ' ' + self.prepare_tags(obj) + ' ' + html.unescape(strip_tags(obj.content))
def prepare_text_auto(self, obj):
return self.prepare_text(obj)