On Saturday 23 May 2009 11:53:08 am Rok wrote:
> I am using @login_required decorator, where "I" do not have to write
> my login view, since decorator does everything "I" want. When user is
> not logged in it gets redirected to LOGIN_URL where he can login, when
> he request URL/view which has @login_required decorator...
>
> But what if user requests LOGIN_URL by writing it directly to the
> browser URL field? User gets login form regardless if he is logged in
> or not.
>

Have you tried using request.user.is_authenticated in the template?

{% if request.user.is_authenticated %} 

You are already logged in. If you're having problems, please clear all your 
cookies and login again. Thanks.

{% else }

Login form

{% endif %}

for request.user to be available, make sure you have 
django.core.context_processors.auth in your TEMPLATE_CONTEXT_PROCESSORS.

Mike

-- 
purpitation, n.:
        To take something off the grocery shelf, decide you
        don't want it, and then put it in another section.
                -- "Sniglets", Rich Hall & Friends

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to