From aad9102a888b6cd5a508d64e812d5fdaea609ef2 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 25 Mar 2026 13:32:31 +0800 Subject: [PATCH] bugfix --- pricing/pricing.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pricing/pricing.py b/pricing/pricing.py index 7757aec..9fd431f 100644 --- a/pricing/pricing.py +++ b/pricing/pricing.py @@ -152,8 +152,12 @@ def check_value(field, spec_value, data_value): mode = field.value_mode if not mode or mode == '=': mode = '==' - script = f'{data_value} {mode} {typevalue(spec_value, field.type)}' - x = eval(script) + ns = { + "a": data_value + "b": typevalue(spec_value, field.type) + } + script = f'a {mode} b' + x = eval(script, ns) return x class PricingProgram: