Re: How to access the request object in a decorator

2008-11-17 Thread TH
Thanks a lot Bruno! That really helped :) On Nov 17, 3:20 am, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 17 nov, 10:02, TH <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > I wanted to redirect a logged in user if he access certain page. For > > example i do not want the user to access

Re: How to access the request object in a decorator

2008-11-17 Thread bruno desthuilliers
On 17 nov, 10:02, TH <[EMAIL PROTECTED]> wrote: > Hello, > > I wanted to redirect a logged in user if he access certain page. For > example i do not want the user to access registration page if he is > logged in. > > A simple way to do this is: > > def register(request): > if request.user.is_a

Re: How to access the request object in a decorator

2008-11-17 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-11-17, o godz. 10:02, przez TH: > I wanted to redirect a logged in user if he access certain page. For > example i do not want the user to access registration page if he is > logged in. > > A simple way to do this is: > > def register(request): >if request.user.

How to access the request object in a decorator

2008-11-17 Thread TH
Hello, I wanted to redirect a logged in user if he access certain page. For example i do not want the user to access registration page if he is logged in. A simple way to do this is: def register(request): if request.user.is_authenticated(): return HttpResponseRedirect('/ some_nice_