Changeset - b2bc08f2974b
[Not reviewed]
default
0 1 0
marcink - 16 years ago 2010-04-07 13:24:46

try except error on non existing user table
1 file changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
pylons_app/lib/auth.py
Show inline comments
 
@@ -17,8 +17,12 @@ def authfunc(environ, username, password
 
    conn, cur = get_sqlite_cur_conn()
 
    password_crypt = crypt.crypt(password, '6a')
 

	
 
    cur.execute("SELECT * FROM users WHERE username=?", (username,))
 
    data = cur.fetchone()
 
    try:
 
        cur.execute("SELECT * FROM users WHERE username=?", (username,))
 
        data = cur.fetchone()
 
    except sqlite3.OperationalError as e:
 
        data = None
 
        log.error(e)
 

	
 
    if data:
 
        if data[3]:
0 comments (0 inline, 0 general)