[cleanup] validate_email_add

This commit is contained in:
Rushabh Mehta
2015-03-23 14:10:38 +05:30
parent 97cc4dd582
commit c2eae25d0e
5 changed files with 15 additions and 17 deletions

View File

@@ -38,8 +38,7 @@ class Lead(SellingController):
frappe.throw(_("Campaign Name is required"))
if self.email_id:
if not validate_email_add(self.email_id):
frappe.throw(_('{0} is not a valid email id').format(self.email_id))
validate_email_add(self.email_id, True)
if self.email_id == self.lead_owner:
# Lead Owner cannot be same as the Lead

View File

@@ -62,8 +62,7 @@ def add_subscribers(name, email_list):
count = 0
for email in email_list.replace(",", "\n").split("\n"):
email = email.strip()
if not validate_email_add(email):
frappe.throw(_("Invalid Email '{0}'").format(email))
validate_email_add(email, True)
if email:
try: