My login controller doesn't work. Problem with fetching username.

Posted by misterwebz on Stack Overflow See other posts from Stack Overflow or by misterwebz
Published on 2010-04-17T17:49:31Z Indexed on 2010/04/17 17:53 UTC
Read the original article Hit count: 191

Filed under:
|

Currently my login controller doesn't work because i can't seem to fetch the username and password.

I'm currently using something like this:

form_username = str(request.params.get('username'))

db_user = meta.Session.query(User).filter_by(username=form_username)
if db_user is None:
    return redirect('auth/error')

No matter which username is use, db_user always returns True and thus never goes to auth/error. I used the shell to play with this and i was able establish a connection with the database, so i'm not sure what i'm doing wrong here.

© Stack Overflow or respective owner

Related posts about sqlalchemy

Related posts about pylons