From f6b8e13a0c7124de8bb6ba020edf576de2459511 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Mon, 1 Jun 2015 17:31:27 +0100 Subject: [PATCH] python2 unicode fix --- wagtail/wagtailcore/rich_text.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wagtail/wagtailcore/rich_text.py b/wagtail/wagtailcore/rich_text.py index 2ba1a52ed5..f8e4e9452d 100644 --- a/wagtail/wagtailcore/rich_text.py +++ b/wagtail/wagtailcore/rich_text.py @@ -1,5 +1,8 @@ +from __future__ import unicode_literals # ensure that RichText.__str__ returns unicode + import re # parsing HTML with regexes LIKE A BOSS. +from django.utils.encoding import python_2_unicode_compatible from django.utils.html import escape from django.utils.safestring import mark_safe @@ -173,6 +176,7 @@ def expand_db_html(html, for_editor=False): return html +@python_2_unicode_compatible class RichText(object): """ A custom object used to represent a renderable rich text value.