Opened 17 years ago

Closed 17 years ago

#4098 closed (fixed)

{% with %} tag references unknown global, tagname

Reported by: cephelo@… Owned by: Adrian Holovaty
Component: Template system Version: dev
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

There's a small error in the default {% with ... %} tag, it references an unknown variable, 'tagname', when used with invalid syntax. [source:/django/trunk/django/template/defaulttags.py] Line 1002, should be:

bits = token.split_contents()
if len(bits) != 4 or bits[2] != "as":
    raise TemplateSyntaxError, "%r expected format is 'value as name'" % bits[0]

Also note that there is a superfluous list() call around token.split_contents().

Change History (1)

comment:1 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [5048]) Fixed #4098 -- fixed a syntax error when reporting errors in "with" template
tag. Thanks cephelo@….

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