str() no longer makes SafeText unsafe, so explicitly modify it

This commit is contained in:
Matt Westcott 2017-12-03 00:48:49 +00:00 committed by Karl Hobley
parent 9bf8735e0e
commit fd4666b257

View file

@ -512,11 +512,11 @@ class RawHTMLBlock(FieldBlock):
def get_prep_value(self, value):
# explicitly convert to a plain string, just in case we're using some serialisation method
# that doesn't cope with SafeText values correctly
return str(value)
return str(value) + ''
def value_for_form(self, value):
# need to explicitly mark as unsafe, or it'll output unescaped HTML in the textarea
return str(value)
return str(value) + ''
def value_from_form(self, value):
return mark_safe(value)