Opened 13 years ago

Closed 12 years ago

#15652 closed Bug (fixed)

dictsort raises TemplateSyntaxError when not provided with a list of dictionaries

Reported by: notifications@… Owned by: Daniel Barreto
Component: Template system Version: 1.3-rc
Severity: Normal Keywords:
Cc: daniel.barreto.n@… 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

For example, if one puts {{ "Hello"|dictsort:"a" }} into a template and render it, it will raise TemplateSyntaxError with Caught VariableDoesNotExist while rendering: Failed lookup for key [a] in u'H'. It should fail silently.

Attachments (1)

0001-Fixed-15652-dictsort-and-dictsortreversed-won-t-rais.patch (3.4 KB ) - added by Daniel Barreto 12 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Julien Phalip, 13 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Luke Plant, 13 years ago

Type: Bug

comment:3 by Luke Plant, 13 years ago

Severity: Normal

comment:4 by Daniel Barreto, 12 years ago

Cc: daniel.barreto.n@… added
Easy pickings: unset
Has patch: set
Owner: changed from nobody to Daniel Barreto
Status: newassigned
UI/UX: unset

adding a patch with some basic tests.

comment:5 by Claude Paroz, 12 years ago

Triage Stage: AcceptedReady for checkin

Looks fine.

comment:6 by Ramiro Morales, 12 years ago

Resolution: fixed
Status: assignedclosed

In [17374]:

Made dictsort and dictsort reversed template filters fail silently
when passed list of things that aren't dictionaries.

Thanks Harris Lapiroff for the report and Daniel Barreto for the patch.

Fixes #15652.

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