python3: use force_text to make sure variables are strings
This commit is contained in:
parent
abeaccc7c1
commit
d4f5c76d0d
|
@ -17,6 +17,7 @@
|
|||
import re
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.encoding import force_text
|
||||
from django.template import Context, Template, TemplateSyntaxError, VariableDoesNotExist
|
||||
from django.utils.http import quote
|
||||
|
||||
|
@ -58,5 +59,5 @@ def get_templated_url(url, context=None):
|
|||
return '['
|
||||
if varname not in template_vars:
|
||||
raise TemplateError('unknown variable %s', varname)
|
||||
return unicode(template_vars[varname])
|
||||
return force_text(template_vars[varname])
|
||||
return re.sub(r'(\[.+?\])', repl, url)
|
||||
|
|
Loading…
Reference in New Issue