Merge pull request #16929 from Mangesh-Khairnar/email-address-fix

refactor: change validate email add to validate email address
This commit is contained in:
Suraj Shetty 2019-03-18 11:26:14 +05:30 committed by GitHub
commit 4713e2dd73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

@ -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"))

View File

@ -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':

View File

@ -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]

View File

@ -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)
from frappe.utils import validate_email_address
validate_email_address(email.strip(), True)