fix: safe check of options in docfield
This commit is contained in:
parent
2c5bc5abcf
commit
5627981192
1 changed files with 3 additions and 2 deletions
|
|
@ -548,12 +548,13 @@ class BaseDocument(object):
|
|||
# data_field options defined in frappe.model.data_field_options
|
||||
for data_field in self.meta.get_data_fields():
|
||||
data = self.get(data_field.fieldname)
|
||||
data_field_options = data_field.get("options")
|
||||
|
||||
if data_field.options == "Email":
|
||||
if data_field_options == "Email":
|
||||
for email_address in frappe.utils.split_emails(data):
|
||||
frappe.utils.validate_email_address(email_address, throw=True)
|
||||
|
||||
if data_field.options == "Phone":
|
||||
if data_field_options == "Phone":
|
||||
frappe.utils.validate_phone_number(data, throw=True)
|
||||
|
||||
def _validate_constants(self):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue