[REF] cosmetic

bzr revid: jth@openerp.com-20110112150136-kzaw52txf5rwadrx
This commit is contained in:
Julien Thewys 2011-01-12 16:01:36 +01:00
parent 0b81c2b136
commit 4448a67b49
1 changed files with 2 additions and 2 deletions

View File

@ -235,12 +235,12 @@ class users(osv.osv):
# If the password 'pw' is not encrypted, then encrypt all passwords
# in the db. Returns the (possibly newly) encrypted password for 'id'.
if pw[0:len(magic_md5)] != magic_md5:
if not pw.startswith(magic_md5):
cr.execute('select id, password from res_users')
res = cr.fetchall()
for i, p in res:
encrypted = p
if p[0:len(magic_md5)] != magic_md5:
if 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)))