prefill: add globals on python formulas
This commit is contained in:
parent
fee585b041
commit
d5171fa2c5
|
@ -442,9 +442,10 @@ class FormPage(Directory):
|
|||
break
|
||||
elif t == 'formula':
|
||||
formula = field.prefill.get('value')
|
||||
variables = get_publisher().substitutions.get_context_variables()
|
||||
try:
|
||||
v = str(eval(formula, variables))
|
||||
v = str(eval(formula,
|
||||
get_publisher().get_global_eval_dict(),
|
||||
get_publisher().substitutions.get_context_variables()))
|
||||
except:
|
||||
pass
|
||||
if v:
|
||||
|
|
Loading…
Reference in New Issue