allow emails with uppercase

This commit is contained in:
Anand Doshi 2012-02-27 13:21:02 +05:30
parent 302f9e4f75
commit 0d00a026b2
3 changed files with 3 additions and 3 deletions

View file

@ -189,7 +189,7 @@ function cint(v, def) {
if(isNaN(v))v=def?def:0; return v;
}
function validate_email(id) {
if(strip(id).search("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?")==-1) return 0; else return 1; }
if(strip(id.toLowerCase()).search("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?")==-1) return 0; else return 1; }
function validate_spl_chars(txt) {
if(txt.search(/^[a-zA-Z0-9_\- ]*$/)==-1) return 1; else return 0; }

File diff suppressed because one or more lines are too long

View file

@ -24,7 +24,7 @@ def getCSVelement(v):
def get_full_name(profile):
"""get the full name (first name + last name) of the user from Profile"""
p = webnotes.conn.sql("""select first_name, last_name from tabProfile
p = webnotes.conn.sql("""select first_name, last_name from `tabProfile`
where name=%s""", profile, as_dict=1)
if p:
p = p[0]