I have two lines of code that read as follows:
if auth.user:
if db.auth_user[auth.user.id]['image']=='' or db.auth_user[auth.user.id]['image']==None:
Recently, while logged in, I dropped all the tables, refreshed the page and then got an Internal Error saying
if db.auth_user[auth.user.id]['image']=='' or db.auth_user[auth.user.id]['image']==None:
TypeError: 'NoneType' object has no attribute '__getitem__'
I'm guessing it has to do with cookies saving the session, where the web2py side recognizes what seems to be a session and building auth.user based off of this, but I'm not quite sure why auth.user is built without a query check of the database? I was wondering why this is?