[FIX] do not encrypt empty password

bzr revid: jth@openerp.com-20110112150518-qup0i5efc4g4xcep
This commit is contained in:
Julien Thewys 2011-01-12 16:05:18 +01:00
parent 4448a67b49
commit c9fc809271
1 changed files with 1 additions and 1 deletions

View File

@ -240,7 +240,7 @@ class users(osv.osv):
res = cr.fetchall()
for i, p in res:
encrypted = p
if not p.startswith(magic_md5):
if p and not p.startswith(magic_md5):
encrypted = encrypt_md5(p, gen_salt())
cr.execute('update res_users set password=%s where id=%s',
(encrypted.encode('utf-8'), int(i)))