Errors resolved but DB queries are not yet issued as I expect.
Login hit now completely working.

The problem was that queries return tuples no matter what. The nested query
cherrypy.request.db.query(q.exists()) also contains nested tuples. I had to
append [0][0] (multidimensional indexing) to get the actual boolean return value.