fix: fail silently
This commit is contained in:
parent
6afa83f2c7
commit
6900a79421
@ -37,7 +37,14 @@ def validate_regional(doc):
|
||||
|
||||
for field in required_fields:
|
||||
condition = field.get("condition")
|
||||
if condition and not frappe.safe_eval(condition, doc.as_dict()):
|
||||
condition_true = True
|
||||
try:
|
||||
condition_true = frappe.safe_eval(condition, doc.as_dict())
|
||||
except:
|
||||
# invalid condition should not result in an error
|
||||
pass
|
||||
|
||||
if condition and not condition_true:
|
||||
continue
|
||||
|
||||
field_name = field.get("field_name")
|
||||
|
Loading…
x
Reference in New Issue
Block a user