Opened 17 years ago

Closed 16 years ago

#5689 closed (worksforme)

Empty/blank URLField evaluates true for template {% if %} tag

Reported by: Simon Litchfield <simon@…> Owned by: nobody
Component: Template system Version: dev
Severity: Keywords: urlfield blank empty if template tag
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As described in summary (rev 6453). Example --

{% if object.url %}
...my html...
{% endif %}

Even where object.url is blank, my html is included. This behaviour is inconsistent with other fields.

I'll supply a patch if anyone is interested.

Change History (2)

comment:1 by Chris Beaven, 16 years ago

Why ask to supply the patch? Just add it! ;)

It sounds like a real bug, anyone care to confirm it?

comment:2 by Jacob, 16 years ago

Resolution: worksforme
Status: newclosed

Without seeing your model, I can't tell if this is a bug in Django or one in your code. I've never seen the {% if %} tag fail in this manner, so I'm marking worksforme.

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