Opened 16 years ago

Closed 16 years ago

#9298 closed (invalid)

Error in tutorial part 4 : if error_message test doesn't work

Reported by: marco_2025 Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In the template vote/detail.html, you have this test :
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}

I think this doesn't work (at least on my machine), because 'error_message' never equals 'true' (it contains a string with the error message).

Change History (1)

comment:1 by Karen Tracey <kmtracey@…>, 16 years ago

Resolution: invalid
Status: newclosed

The test works as written. Per the doc on the if tag:

http://docs.djangoproject.com/en/dev/ref/templates/builtins/#if

the test evaluates to "true" if the variable argument "exists, is not empty, and is not a false boolean value".

If this is not working correctly on your machine something weird is going on.

Note: See TracTickets for help on using tickets.
Back to Top