#13373 closed (fixed)
IF tag no longer short-circuits
Reported by: | (none) | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | 1.2-beta |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
It looks like {% if %} with OR or AND no longer short circuits under 1.2-beta-1.
class Page(models.Model):
...
def beTrue(self):
print "BEING TRUE"
return True
def beFalse(self):
print "BEING FALSE"
return False
{% if page.beTrue or page.beFalse %}
HELLO
{% endif %}
Under 1.1.1, using manage.py runserver, I will only see "BEING TRUE" printed for the above snippet. Under 1.2-beta-1, I see both BEING TRUE and BEING FALSE.
Similarly,
{% if page.beFalse and page.beTrue %}
HELLO
{% endif %}
will produce only "BEING FALSE" under 1.1.1, but both BEING FALSE and BEING TRUE under 1.2-beta-1.
Change History (7)
comment:1 by , 15 years ago
comment:3 by , 15 years ago
milestone: | → 1.2 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:4 by , 15 years ago
Thanks, Alex, but the problem has become recursive--my address now appears in your change history, where it's still public. How can I get rid of it completely?
comment:5 by , 15 years ago
Reporter: | removed |
---|
Unfortunately if I remove the change in the admin it restores the original field. Sorry this is beyond my knowledge at this point.
comment:6 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I didn't realize that the e-mail address it requests is displayed publicly. How can I remove that?