[FIX] Login : Login and password accepting accented characters

lp bug: https://launchpad.net/bugs/409343 fixed

bzr revid: jvo@tinyerp.com-20090806085328-os4ymz6mjjp0qw2d
This commit is contained in:
SME,JVO
2009-08-06 14:23:28 +05:30
committed by Jay (Open ERP)
parent 11725f1c90
commit 93636db0c3
+2 -2
View File
@@ -28,9 +28,9 @@ _uid_cache = {}
def login(db, login, password):
cr = pooler.get_db(db).cursor()
if password:
cr.execute('select id from res_users where login=%s and password=%s and active', (login.encode('utf-8'), password.encode('utf-8')))
cr.execute('select id from res_users where login=%s and password=%s and active', (tools.ustr(login), tools.ustr(password)))
else:
cr.execute('select id from res_users where login=%s and password is null and active', (login.encode('utf-8'),))
cr.execute('select id from res_users where login=%s and password is null and active', (tools.ustr(login),))
res = cr.fetchone()
cr.close()
if res: