I have a function whose definition starts as follows:

@auth.requires_login()
def rbb_time(category_id, from_date, to_date, user_id=auth.user.id):

It works fine. I'll leave the development of this application for a few
days, come back, run it, and get:

Traceback (most recent call last):
  File "/home/kae/hg/kae/web2py.1.99.4.pytrack2/gluon/restricted.py", line
  204, in restricted exec ccode in environment
File "[...]/controllers/default.py", line 100, in <module> 
  def rbb_time(category_id, from_date, to_date, user_id=auth.user.id): 
AttributeError: 'NoneType' object has no attribute 'id'

The only way to fix it (and this isn't 100% reliable) is to comment out
all of the "@auth.requires_login()" lines, hard-code the above function
definition to end "user_id=11" (the UID I was logged in as), and then
call /default/user/logout.

Can anyone offer any suggestions as to what is going on here?

Thanks,
Keith

Reply via email to