Opened 18 years ago
Closed 18 years ago
#2303 closed defect (fixed)
[patch] Recent break to template resolve_variable with booleans
Reported by: | anonymous | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | major | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Unable to evaluate "True" and "False" values inside an ifequal tag. The tag "{% ifequal 0 False %}" results in this exception:
Traceback (most recent call last): File "/home/pete/src/osrc/django/django/template/__init__.py" in render_node 706. result = node.render(context) File "/home/pete/src/osrc/django/django/template/defaulttags.py" in render 155. val2 = resolve_variable(self.var2, context) File "/home/pete/src/osrc/django/django/template/__init__.py" in resolve_variable 664. return current UnboundLocalError at / local variable 'current' referenced before assignment
The special cases for False and True do not set the local "current" variable,
which gets returned at the end of the function.
Looks like bug crept in from changeset:3269
Attachments (1)
Change History (3)
by , 18 years ago
Attachment: | templatebools.diff added |
---|
comment:1 by , 18 years ago
Summary: | Recent break to template resolve_variable with booleans → [patch] Recent break to template resolve_variable with booleans |
---|
comment:2 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Patch