Opened 7 years ago

Closed 7 years ago

#28662 closed Bug (fixed)

join template filter no longer silences invalid argument errors

Reported by: Tim Graham Owned by: Mads Jensen
Component: Template system Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Failing test:

@setup({'badtemplate_join': '{% autoescape off %}{{ a|join:var }}{% endautoescape %}'})
def test_join_fail_silently(self):
    obj = object()
    output = self.engine.render_to_string('badtemplate_join', {'a': obj, 'var': ' & '})
    self.assertEqual(output, mark_safe(obj))

It looks like the same problem exists if autoescape is enabled.

Regression in 0349d83289f0d88069eccfead78b71da8e158d41 and e64cdf7129c5ff9a0229d6c3fcde00079a70a4f9, I think.

This was discovered in PR 9149 and Mads will provide the fix.

Change History (1)

comment:1 by Tim Graham <timograham@…>, 7 years ago

Resolution: fixed
Status: assignedclosed

In f7036b3e:

Fixed #28662 -- Silenced join template filter error if arg isn't iterable.

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