Opened 15 years ago

Closed 14 years ago

Last modified 13 years ago

#12070 closed (fixed)

Variable("a._hidden") does not raise TemplateSyntaxError

Reported by: Johannes Dollinger Owned by: alexdutton
Component: Template system Version: 1.1
Severity: Keywords: variable, filterexpression, private, underscore
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

>>> Variable("a._hidden")
<Variable: 'a._hidden'>
>>> FilterExpression("a._hidden", p)
...
TemplateSyntaxError: Variables and attributes may not begin with underscores: 'a._hidden'

This should be consistent.

Attachments (1)

patch-12070.diff (2.1 KB ) - added by alexdutton 14 years ago.
Patch (Unindented '...'s to match style in other doctests)

Download all attachments as: .zip

Change History (7)

comment:1 by Russell Keith-Magee, 14 years ago

milestone: 1.2
Triage Stage: UnreviewedAccepted

comment:2 by alexdutton, 14 years ago

Has patch: set
Owner: changed from nobody to alexdutton

Attached patch with two new doctests in regressiontests/templates/parser.py.

Moved the check for '._' from FilterExpression to Variable, given the former calls the latter.

No documentation needed; (hopefully ready for check-in)

by alexdutton, 14 years ago

Attachment: patch-12070.diff added

Patch (Unindented '...'s to match style in other doctests)

comment:3 by Alex Gaynor, 14 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by jkocherhans, 14 years ago

Resolution: fixed
Status: newclosed

(In [12539]) Fixed #12070. Fixed a case where var._whatever wasn't raising a TemplateSyntaxError.

comment:5 by jkocherhans, 14 years ago

(In [12540]) [1.1.X] Fixed #12070. Fixed a case where var._whatever wasn't raising a TemplateSyntaxError. Backport of r12539 from trunk.

comment:6 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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