#10644 closed (fixed)
undocumented context side-effect in {% ifchanged %}
Reported by: | Antti Kaihola | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The {% ifchanged %}
template tag sets the {{ ifchanged }}
variable in its local context, in a way similar to how {% for %}
sets the {{ forloop }}
variable. This behavior is not documented. The value stored into the variable is a dictionary and doesn't seem to have any use elsewhere in Django. Maybe it's related to some removed functionality?
These quick Google code searches didn't turn up any uses of the context variable in indexed open source projects either:
The following patch stops {% ifchanged %}
from touching the context and adds a test for this.
Attachments (1)
Change History (5)
by , 16 years ago
Attachment: | 10644_ifchanged.1.diff added |
---|
comment:1 by , 16 years ago
Version: | 1.0 → SVN |
---|
comment:2 by , 16 years ago
milestone: | → 1.1 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch: stop {% ifchanged %} from changing context, includes test