Cant login to my app

31 views
Skip to first unread message

Maurice Waka

unread,
Mar 30, 2018, 10:01:45 AM3/30/18
to web2py-users
I have been getting this error in the last few days but somehow, with restarting my comp, the error is sorted out. Every time I create a new module and test it in the app, the error appears.
This is the latest, and this time, even with restarting the system, the error below appears and I cant use the app.

name = [t.reply for t in db(db.post.author == auth.user.id).select(db.post.ALL)][-1]]

AttributeErroe: 'NoneType' object has no attribute 'id'

Kind regards

Jim S

unread,
Mar 30, 2018, 12:38:11 PM3/30/18
to web2py-users
Is this really in a module?  Have you imported auth and set it to the current auth before the line you specified?

I don't think auth works within a module by default.

-Jim

Anthony

unread,
Mar 30, 2018, 9:25:57 PM3/30/18
to web2py-users
That error indicates there is no auth.user and therefore you are not logged in. But we need more information to help determine why you are not logged in if you think you should be.

Anthony

Anthony

unread,
Mar 30, 2018, 9:27:16 PM3/30/18
to web2py-users
On Friday, March 30, 2018 at 12:38:11 PM UTC-4, Jim S wrote:
Is this really in a module?  Have you imported auth and set it to the current auth before the line you specified?

That isn't the issue here, as the "auth" object is clearly defined in the context presented -- it's just missing the "user" attribute (indicating no login).

Anthony

Maurice Waka

unread,
Mar 31, 2018, 1:07:12 PM3/31/18
to web...@googlegroups.com
I just found out that I had called a function within the module which was not supposed to be. That was the bug. 

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/bH3KyE3E9bw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages