Opened 9 years ago

Closed 8 years ago

#25031 closed Bug (fixed)

unordered_list template filter fails for certain sequences

Reported by: Noam Owned by: nobody
Component: Template system Version: 1.8
Severity: Release blocker Keywords: unordered_list template filter
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

unordered_list consumes it's input by pairs. When given a sequence that contains at an even position two strings and then a list (such as ['a', 'a', ['b']]), it will consume both strings and treat the list as an item on it's own, and not as a sublist of the second string.

The result:

>>> from django.template import defaultfilters
>>> print str(defaultfilters.unordered_list(['a', 'a', ['b']]))
	<li>a</li>
	<li>a</li>
	<li>[&#39;b&#39;]</li>

See pull request with a test and a fix:
https://github.com/django/django/pull/4917

Change History (5)

comment:1 by Tim Graham, 9 years ago

Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

comment:2 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In e291fc4:

Fixed #25031 -- Fixed a regression in the unordered_list template filter.

comment:3 by Tim Graham <timograham@…>, 9 years ago

In fd61ce38:

[1.8.x] Fixed #25031 -- Fixed a regression in the unordered_list template filter.

Backport of e291fc4757e952fd4f663d88adca416b016db13e from master

comment:4 by msimonds, 8 years ago

Resolution: fixed
Status: closednew

This is still causing me trouble.

comment:5 by Tim Graham, 8 years ago

Resolution: fixed
Status: newclosed

Please open a new ticket with steps to reproduce the issue, thanks.

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