From b3434072367a214361e0932a9cdc4350a71fcd30 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Sat, 16 Mar 2019 13:38:53 +0530 Subject: [PATCH] refactor: change validate email add to validate email address --- erpnext/crm/doctype/lead/lead.py | 4 ++-- erpnext/hr/doctype/employee/employee.py | 6 +++--- erpnext/hr/doctype/job_applicant/job_applicant.py | 4 ++-- erpnext/non_profit/doctype/member/member.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py index 29ca71bd88..442b6c2db2 100644 --- a/erpnext/crm/doctype/lead/lead.py +++ b/erpnext/crm/doctype/lead/lead.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe from frappe import _ -from frappe.utils import (cstr, validate_email_add, cint, comma_and, has_gravatar, now, getdate, nowdate) +from frappe.utils import (cstr, validate_email_address, cint, comma_and, has_gravatar, now, getdate, nowdate) from frappe.model.mapper import get_mapped_doc from erpnext.controllers.selling_controller import SellingController @@ -38,7 +38,7 @@ class Lead(SellingController): if self.email_id: if not self.flags.ignore_email_validation: - validate_email_add(self.email_id, True) + validate_email_address(self.email_id, True) if self.email_id == self.lead_owner: frappe.throw(_("Lead Owner cannot be same as the Lead")) diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index d518cd8995..a403c393b9 100755 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -from frappe.utils import getdate, validate_email_add, today, add_years, format_datetime +from frappe.utils import getdate, validate_email_address, today, add_years, format_datetime from frappe.model.naming import set_name_by_naming_series from frappe import throw, _, scrub from frappe.permissions import add_user_permission, remove_user_permission, \ @@ -142,9 +142,9 @@ class Employee(NestedSet): def validate_email(self): if self.company_email: - validate_email_add(self.company_email, True) + validate_email_address(self.company_email, True) if self.personal_email: - validate_email_add(self.personal_email, True) + validate_email_address(self.personal_email, True) def validate_status(self): if self.status == 'Left': diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.py b/erpnext/hr/doctype/job_applicant/job_applicant.py index ea81fe793d..4fc7719f38 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant.py +++ b/erpnext/hr/doctype/job_applicant/job_applicant.py @@ -7,7 +7,7 @@ from __future__ import unicode_literals from frappe.model.document import Document import frappe from frappe import _ -from frappe.utils import comma_and, validate_email_add +from frappe.utils import comma_and, validate_email_address sender_field = "email_id" @@ -28,7 +28,7 @@ class JobApplicant(Document): def validate(self): self.check_email_id_is_unique() if self.email_id: - validate_email_add(self.email_id, True) + validate_email_address(self.email_id, True) if not self.applicant_name and self.email_id: guess = self.email_id.split('@')[0] diff --git a/erpnext/non_profit/doctype/member/member.py b/erpnext/non_profit/doctype/member/member.py index b9b2dd8fc9..9afaf90e7a 100644 --- a/erpnext/non_profit/doctype/member/member.py +++ b/erpnext/non_profit/doctype/member/member.py @@ -17,5 +17,5 @@ class Member(Document): self.validate_email_type(self.email) def validate_email_type(self, email): - from frappe.utils import validate_email_add - validate_email_add(email.strip(), True) \ No newline at end of file + from frappe.utils import validate_email_address + validate_email_address(email.strip(), True) \ No newline at end of file