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_page_for_logged_in_user')
    ...

The problem is i have lot of pages that only anonymous user can
access. So i wanted to write a decorator so that i can do something
like that


@anonymous_only
def register(request):

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to