#27058: {% for %} tag unpacking: less strict checks
--------------------------------------+------------------------------------
     Reporter:  sergei-maertens       |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Template system       |                  Version:  1.10
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by timgraham):

 The ticket for the deprecation and error message is #13408. That code
 isn't new in 1.10 (rather in 1.8) so there's no regression as far as I
 understand. I removed the code comment about "To complete this
 deprecation" earlier today (ba749f8f87dd60b20aeaefb84ee182f192746ebf) as
 that deprecation did complete in 1.10.

 Here's a test case that passes on master but fails with your proposed
 patch. As to whether or not that's a case to protect against, I guess it's
 probably better to assume that the programmer won't make a mistake like
 that if it prevents other use cases.
 {{{#!python
 @setup({'for-tag-unpack15': '{% for x,y in items %}{{ x }}:{{ y }}/{%
 endfor %}'})
 def test_for_tag_unpack15(self):
     with self.assertRaisesMessage(ValueError, 'Need 2 values to unpack in
 for loop; got 1.'):
         self.engine.render_to_string('for-tag-unpack15', {'items': ('ab',
 'ac')})
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27058#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/073.16d5c6a318a857bf00a60fbfb38851ce%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to