From 69697bc1723a195134ca70f40af1f1066a3f7f4e Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 16 Jul 2015 11:51:55 +0530 Subject: [PATCH] [fix] validate_email_add --- frappe/utils/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frappe/utils/__init__.py b/frappe/utils/__init__.py index 99ca37661b..fee581762f 100644 --- a/frappe/utils/__init__.py +++ b/frappe/utils/__init__.py @@ -78,14 +78,16 @@ def validate_email_add(email_str, throw=False): if not match: return False + matched = match.group(0) + if match: - match = match.group(0)==email.lower() + match = matched==email.lower() if not match and throw: frappe.throw(frappe._("{0} is not a valid email id").format(email), frappe.InvalidEmailAddressError) - return email.lower() + return matched def random_string(length): """generate a random string"""