Allow to have accent in password

This commit is contained in:
Cédric Krier committed 2009-09-23 18:42:27 +02:00
1 parent dab3db6112
commit 69b14b9b70
2 files changed
+3

No files matched your search

+2
View File
@@ -389,6 +389,8 @@ class User(ModelSQL, ModelView):
if not user_id:
return 0
password += salt or ''
if isinstance(password, unicode):
password = password.encode('utf-8')
if hashlib:
password_sha = hashlib.sha1(password).hexdigest()
else:
+1
View File
@@ -20,6 +20,7 @@ def login(dbname, loginname, password, cache=True):
if not dbname in database_list:
pool.init()
user_obj = pool.get('res.user')
password = password.decode('utf-8')
user_id = user_obj.get_login(cursor, 0, loginname, password)
cursor.commit()
cursor.close()