[fix] use the new split_emails method to split emails by comma

This commit is contained in:
Anand Doshi
2015-09-16 19:20:55 +05:30
parent c19afa140d
commit c5f919eb68
4 changed files with 7 additions and 8 deletions

View File

@@ -4,7 +4,7 @@ import frappe.utils
import frappe.defaults
from frappe.utils import add_days, cint, cstr, date_diff, flt, getdate, nowdate, \
get_first_day, get_last_day, comma_and
get_first_day, get_last_day, comma_and, split_emails
from frappe.model.naming import make_autoname
from frappe import _, msgprint, throw
@@ -33,7 +33,7 @@ def manage_recurring_documents(doctype, next_date=None, commit=True):
next_date = next_date or nowdate()
date_field = date_field_map[doctype]
condition = " and ifnull(status, '') != 'Stopped'" if doctype in ("Sales Order", "Purchase Order") else ""
recurring_documents = frappe.db.sql("""select name, recurring_id
@@ -180,8 +180,7 @@ def convert_to_recurring(doc, posting_date):
def validate_notification_email_id(doc):
if doc.notification_email_address:
email_list = filter(None, [cstr(email).strip() for email in
doc.notification_email_address.replace("\n", "").split(",")])
email_list = split_emails(doc.notification_email_address.replace("\n", ""))
from frappe.utils import validate_email_add
for email in email_list: