I have am menu with someting like
('stop_impersonating', ... is_impersonating()),...
This menu entry should only be activ when impersonating is activ.
Now I have tried a fresh installation of web2py and I got:
Traceback (most recent call last):
File "/etc/web2py/gluon/restricted.py", line 205, in restricted
exec ccode in environment
File "/etc/web2py/applications/secure/models/menu.py"
<https://86.59.42.84/admin/default/edit/secure/models/menu.py>, line
69, in <module>
(SPAN(T('Imitieren beenden'),_style='color:red'), False,
URL('personen','impersonateEnd',),[],auth.is_impersonating()), #
File "/etc/web2py/gluon/tools.py", line 2595, in is_impersonating
return 'impersonator' in current.session.auth
TypeError: argument of type 'NoneType' is not iterable
I think, current.session is not defined at the start of the program
I have tried (gluon/tools.py line 2595)
def is_impersonating(self):
return self.is_logged_in() and 'impersonator' in
current.session.auth
Maybe there is a better solution, but it works
Regards, Martin
--