Hey folks,

I've a strange problem at the moment with auth and login decorator.
If a user is logged in index page have to redirect to portal, if the
user is not logged in portal have to redirect to login-screen/index.
Seems to be not a big problem, I thought, but my following code
creates a loop.
If I load the index and I'm logged in, it redirects to portal than
login_required thinks I'm not logged in (but I'm still logged in) and
wants to redirect to login-page, is_authenticated return the right
value True and so on.

def index(request):
    if request.user.is_authenticated():
        return HttpResponseRedirect("portal")
    return someotherstuff

@login_required
def portal(request):
    t = get_template( 'portal.html' )
    dic['menu'] = menu.get_menulist( request )
    html = t.render( Context( dic ) )
    return HttpResponse( html )

For me this behaviour is impossible, but it doesn't wonder me, I think
there are incompatibilities between my karma and the Django user
authentication ;)

greets and thanks,
florian
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to