On Mon, Jun 30, 2008 at 5:14 PM, Ayaz Ahmed Khan
<[EMAIL PROTECTED]> wrote:
>
> On Jun 30, 8:05 pm, "Paolo Ambrosio" <[EMAIL PROTECTED]>
> wrote:
>> On Mon, Jun 30, 2008 at 4:52 PM, Ayaz Ahmed Khan
>>
>> <[EMAIL PROTECTED]> wrote:
>> > [...] The variable "next"
>> > does have that particular value (I verified both by printing it out
>> > and by making sure {% if next %} evaluates to True). However, the
>> > "ifequal" expression just doesn't work.
>>
>> Are you passing it through the context while invoking the template?
>
> I, myself, am not passing that particular value. I am calling the
> built-in login view provided by Django -- which is ``from
> django.contrib.auth.views import login''. That view passes the "next"
> as part of the context while rendering the login template.
I just built a test application and it works for me, if I understood
what is your problem.
I created a view protected by the @login_required decorator, mapped to
two different urls:
1) /accounts/test1/
2) /accounts/test2/
The login_required redirects to /accounts/login/?next=... that calls
the same view you are using.
And this is my template ("registration/login.html"):
{{ next }} - {% ifequal next "/accounts/test1/" %}true{% endifequal %}
If I go to http://localhost:8000/accounts/test1/, I am redirected to
http://localhost:8000/accounts/login/?next=/accounts/test1/ that
shows:
/accounts/test1/ - true
otherwise if I go to http://localhost:8000/accounts/test2/ I see:
/accounts/test2/ -
Maybe yours is just a typo.
Paolo
P.S.
I am using the trunk
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---