Is this the actual trunc-version? Version 2.1.1 (2012-10-16 06:19:35) dev
I get the same message <type 'exceptions.UnboundLocalError'> local variable 'user' referenced before assignment 2012/10/16 Massimo Di Pierro <massimo.dipie...@gmail.com> > There is a bug, I just fixed it in trunk. > > auth.impersonate(0) > is correct. > > > On Tuesday, 16 October 2012 04:38:35 UTC-5, mweissen wrote: >> >> I have called >> auth.impersonate(0) >> to finish impersonation. >> >> Now (Version 2.1.1) I see: >> >> >> Traceback (most recent call last): >> File "H:\...\web2py\gluon\**restricted.py", line 209, in restricted >> >> >> >> >> exec ccode in environment >> File "H:/.../applications/secure/**controllers/default.py" >> <http://127.0.0.1:8000/admin/default/edit/secure/controllers/default.py>, >> line 3988, in <module> >> >> >> >> >> File "H:\...\web2py\gluon\globals.**py", line 187, in <lambda> >> >> >> >> >> self._caller = lambda f: f() >> >> >> >> >> File "H:/.../applications/secure/**controllers/default.py" >> <http://127.0.0.1:8000/admin/default/edit/secure/controllers/default.py>, >> line 1932, in impersonateEnd >> >> >> >> >> auth.impersonate(0) >> File "H:\...\web2py\gluon\tools.py"**, line 2755, in impersonate >> >> >> >> >> return SQLFORM(table_user, user.id, readonly=True) >> >> >> >> UnboundLocalError: local variable 'user' referenced before assignment >> >> >> My function: >> def impersonateEnd(): >> auth.impersonate(0) >> redirect(URL('index',vars=**dict(flash=T('End of impersonation')))) >> >> What ist the best way to end impersonation? >> >> Regards, Martin >> > -- > > > > -- Mit freundlichen Grüßen / With kind regards Martin Weissenböck Gregor-Mendel-Str. 37, 1190 Wien Austria / European Union Tel +43 1 31400 00 Fax +43 1 31400 700 --