Re: [web2py] Re: is_impersonating() as boolean in menu

2012-08-03 Thread Jonathan Lundell
On 3 Aug 2012, at 4:50 AM, Martin Weissenboeck wrote: > Sorry, my tests were wrong. Please forget my last mail. > I think I have mixed two versions on my computer. I have tested it again and > now is_imperonating works as expected. > Thank you! That's good. I've been trying to reproduce it in a

Re: [web2py] Re: is_impersonating() as boolean in menu

2012-08-03 Thread Martin Weissenboeck
Sorry, my tests were wrong. Please forget my last mail. I think I have mixed two versions on my computer. I have tested it again and now is_imperonating works as expected. Thank you! 2012/8/3 Massimo Di Pierro > Clearly there is a problem with that function. If auth is defined, I'd > expect > >

Re: [web2py] Re: is_impersonating() as boolean in menu

2012-08-02 Thread Massimo Di Pierro
Clearly there is a problem with that function. If auth is defined, I'd expect >>> a=dict() >>> 'x' in a False >>> a=dict(x=1) >>> 'x' in a True >>> The problem I have is that it fails when the user is not logged in. Perhaps this is the related to your problem? I have a possible fix in trunk. P

Re: [web2py] Re: is_impersonating() as boolean in menu

2012-08-02 Thread Martin Weissenboeck
Interesting results (Version 2.00.0 (2012-08-02 21:51:02) dev) >From tools.py: def is_impersonating(self): return 'impersonator' in current.session.auth The return value of is_impersonating is not False or True but None or the whole current.session.auth as string. A change in tools.p

[web2py] Re: is_impersonating() as boolean in menu

2012-07-29 Thread Massimo Di Pierro
I think this should be considered a bug. Than you check trunk? On Sunday, 29 July 2012 05:37:51 UTC-5, weheh wrote: > > I haven't traced through all the code carefully, but is_impersonating() > returns current.session.auth.impersonator, which is based on a cPickle. So > you're not getting a boo

[web2py] Re: is_impersonating() as boolean in menu

2012-07-29 Thread weheh
I haven't traced through all the code carefully, but is_impersonating() returns current.session.auth.impersonator, which is based on a cPickle. So you're not getting a boolean, as you might be led to expect from the name of the function. On Sunday, July 29, 2012 1:38:42 PM UTC+8, mweissen wro