misc: use lazy mode for variables in template evaluations (#38332)
This commit is contained in:
parent
c9ba994312
commit
ee4d46947a
|
@ -1880,7 +1880,8 @@ class WorkflowStatusItem(XmlSerialisable):
|
|||
if expression['type'] == 'text':
|
||||
return expression['value']
|
||||
|
||||
vars = get_publisher().substitutions.get_context_variables()
|
||||
vars = get_publisher().substitutions.get_context_variables(
|
||||
'lazy' if expression['type'] == 'template' else None)
|
||||
vars.update(context or {})
|
||||
|
||||
def log_exception(exception):
|
||||
|
@ -2607,7 +2608,7 @@ register_item_class(SendmailWorkflowStatusItem)
|
|||
|
||||
|
||||
def get_formdata_template_context(formdata=None):
|
||||
ctx = get_publisher().substitutions.get_context_variables()
|
||||
ctx = get_publisher().substitutions.get_context_variables('lazy')
|
||||
if formdata:
|
||||
ctx['url'] = formdata.get_url()
|
||||
ctx['url_status'] = '%sstatus' % formdata.get_url()
|
||||
|
@ -2763,7 +2764,7 @@ class DisplayMessageWorkflowStatusItem(WorkflowStatusItem):
|
|||
if not (self.message and self.position == position and self.is_for_current_user(filled)):
|
||||
return ''
|
||||
|
||||
dict = copy.copy(get_publisher().substitutions.get_context_variables())
|
||||
dict = copy.copy(get_publisher().substitutions.get_context_variables('lazy'))
|
||||
dict['date'] = misc.localstrftime(filled.receipt_time)
|
||||
dict['number'] = filled.id
|
||||
handling_role = filled.get_handling_role()
|
||||
|
|
Loading…
Reference in New Issue