misc: fully disable complex data support if feature flag is off (#50184)
This commit is contained in:
parent
57471aba85
commit
ec9d87cd2d
|
@ -117,7 +117,7 @@ if not hasattr(django.template.base, '_monkeypatched'):
|
|||
orig_render_value_in_context = django.template.base.render_value_in_context
|
||||
|
||||
def new_render_value_in_context(value, context):
|
||||
if 'allow_complex' in context and not isinstance(value, str):
|
||||
if context.get('allow_complex') and not isinstance(value, str):
|
||||
return get_publisher().cache_complex_data(value)
|
||||
return orig_render_value_in_context(value, context)
|
||||
|
||||
|
|
|
@ -1998,7 +1998,7 @@ class WorkflowStatusItem(XmlSerialisable):
|
|||
exception=exception)
|
||||
|
||||
if expression['type'] == 'template':
|
||||
vars['allow_complex'] = allow_complex
|
||||
vars['allow_complex'] = allow_complex and get_publisher().has_site_option('complex-data')
|
||||
try:
|
||||
return Template(expression['value'], raises=raises, autoescape=False).render(vars)
|
||||
except TemplateError as e:
|
||||
|
|
Loading…
Reference in New Issue