#23883: flatatt modifies passed in dict, possibly changing the result of 
subsequent
calls
-------------------------------+--------------------
     Reporter:  timheap        |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  Uncategorized  |    Version:  master
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 The updated `django.forms.utils.flatatt` function modifies the dict passed
 in, deleting any boolean attributes it encounters. Calling the function
 twice using the same dict that contains boolean attributes will thus
 result in different output, as the boolean attributes have been deleted:

 {{{#!python
 >>> attrs = {'hello': 'world', 'data-true': True, 'data-false': False}
 >>> flatatt(attrs)
 ' hello="world" data-true'
 >>> flatatt(attrs)
 ' hello="world"'
 }}}

 The function should not modify the dict passed in like it does, leaving it
 unchanged. Fixing this will make the function behave as expected when
 called with the same dict twice.

--
Ticket URL: <https://code.djangoproject.com/ticket/23883>
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/050.c97a14a797df350bcf79209a9000f98b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to