Browse Source

[fix] email validate

version-14
Rushabh Mehta 8 years ago
parent
commit
53f12a8b75
1 changed files with 10 additions and 6 deletions
  1. +10
    -6
      frappe/utils/__init__.py

+ 10
- 6
frappe/utils/__init__.py View File

@@ -99,15 +99,19 @@ def validate_email_add(email_str, throw=False):
if match:
match = matched==e.lower()

if not match and throw:
frappe.throw(frappe._("{0} is not a valid Email Address").format(e),
frappe.InvalidEmailAddressError)

return matched
if not valid:
if throw:
frappe.throw(frappe._("{0} is not a valid Email Address").format(e),
frappe.InvalidEmailAddressError)
return None
else:
return matched

out = []
for e in email_str.split(','):
out.append(_check(e.strip()))
email = _check(e.strip())
if email:
out.append(email)

return ', '.join(out)



Loading…
Cancel
Save