Opened 5 years ago

Closed 3 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 Changed 5 years ago by Tim Graham

Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

comment:2 Changed 5 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In e291fc4:

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

comment:3 Changed 5 years ago by Tim Graham <timograham@…>

In fd61ce38:

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

Backport of e291fc4757e952fd4f663d88adca416b016db13e from master

comment:4 Changed 3 years ago by msimonds

Resolution: fixed
Status: closednew

This is still causing me trouble.

comment:5 Changed 3 years ago by Tim Graham

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