misc: use SafeText instead of SafeUnicode (#36515)
This commit is contained in:
parent
b9c1293608
commit
7614f40bcd
|
@ -24,7 +24,7 @@ from django.template import (engines,
|
|||
VariableDoesNotExist as DjangoVariableDoesNotExist)
|
||||
from django.template.loader import render_to_string
|
||||
from django.utils.encoding import force_text, smart_text
|
||||
from django.utils.safestring import SafeString, SafeUnicode
|
||||
from django.utils.safestring import SafeString, SafeText
|
||||
from django.utils.six import StringIO
|
||||
|
||||
from quixote import get_session, get_request, get_response, get_publisher
|
||||
|
@ -529,7 +529,7 @@ def variable_resolve(self, context):
|
|||
# don't crash on non-ascii variable names
|
||||
return context.template.engine.string_if_invalid
|
||||
if isinstance(value, SafeString):
|
||||
return SafeUnicode(value, 'utf-8')
|
||||
return SafeText(value, 'utf-8')
|
||||
if isinstance(value, str):
|
||||
return force_text(value, 'utf-8')
|
||||
return value
|
||||
|
|
Loading…
Reference in New Issue