← Back to team overview

launchpad-dev team mailing list archive

Re: Login helper love!

 

On Tue, Jul 20, 2010 at 3:57 PM, Julian Edwards
<julian.edwards@xxxxxxxxxxxxx> wrote:
> On Tuesday 20 July 2010 10:36:51 Jonathan Lange wrote:
...
>> with celebrity_logged_in('admin'):
>>     ubuntu.name = 'jonobuntu'
...
>
> This is very cool, thanks Jono.
>
> What happens when the 'with' block finishes, does it log out or do nothing
> special?
>

If you were logged out before, it logs you out. If you were logged in
(even as ANONYMOUS), it logs you in with the previously logged-in
account.

In other words, your login state after the with block is exactly the
same as before the with block.

jml



Follow ups

References