I get  the following error for trying that:
print db.auth_user[auth.user.id]
AttributeError: 'NoneType' object has no attribute 'id'

I thought `auth.user` is supposed to be used to check if the user is logged 
in?

On Sunday, August 4, 2013 10:35:14 AM UTC-4, Massimo Di Pierro wrote:
>
> If you are not logged in db.auth_user[auth.user.id] is None.
>
>
> On Sunday, 4 August 2013 09:10:09 UTC-5, Mark Finkelstein wrote:
>>
>> 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?
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to