fix: fail silently

This commit is contained in:
barredterra 2020-12-22 11:37:13 +01:00
parent 6afa83f2c7
commit 6900a79421

View File

@ -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")