summaryrefslogtreecommitdiff
path: root/addons/base_crypt/crypt.py
diff options
context:
space:
mode:
authorP. Christeas <p_christ@hol.gr>2010-12-28 11:48:31 +0200
committerP. Christeas <p_christ@hol.gr>2010-12-28 11:48:31 +0200
commitcbbd367c00a29acbc5d30f351d4a0cba8afd9e67 (patch)
tree6a9be38296e35a3039d8a60cdbd03221b8623af8 /addons/base_crypt/crypt.py
parentb7983627a6393418dc2f54fc2a093ffe5e1e47ec (diff)
base_crypt: write query with %s
bzr revid: p_christ@hol.gr-20101228094831-ci5zz12y37miby0g
Diffstat (limited to 'addons/base_crypt/crypt.py')
-rwxr-xr-xaddons/base_crypt/crypt.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/base_crypt/crypt.py b/addons/base_crypt/crypt.py
index 2d29704aeb0..839ebafb498 100755
--- a/addons/base_crypt/crypt.py
+++ b/addons/base_crypt/crypt.py
@@ -178,7 +178,7 @@ def check(db, uid, passwd):
return True
cr = pooler.get_db(db).cursor()
if passwd not in _salt_cache:
- cr.execute( 'select login from res_users where id=%d', (uid,) )
+ cr.execute( 'select login from res_users where id=%s', (uid,) )
stored_login = cr.fetchone()
if stored_login:
stored_login = stored_login[0]
@@ -186,7 +186,7 @@ def check(db, uid, passwd):
if not login(db,stored_login,passwd):
return False
salt = _salt_cache[passwd]
- cr.execute(' select count(*) from res_users where id=%d and password=%s', (int(uid), encrypt_md5( passwd, salt )) )
+ cr.execute(' select count(*) from res_users where id=%s and password=%s', (int(uid), encrypt_md5( passwd, salt )) )
res = cr.fetchone()[0]
cr.close()
if not bool(res):