#29158: ModelChoiceField crashes when checking choices' length if queryset is a
manager
-------------------------------------+-------------------------------------
     Reporter:  François Freitag     |                    Owner:  François
                                     |  Freitag
         Type:  Bug                  |                   Status:  closed
    Component:  Forms                |                  Version:  1.8
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"40f0aa988571431508a508f4fac5ba94c6443f5c" 40f0aa98]:
 {{{
 #!CommitTicketReference repository=""
 revision="40f0aa988571431508a508f4fac5ba94c6443f5c"
 Fixed #29158 -- Fixed len(choices) crash if ModelChoiceField's queryset is
 a manager.

 Removing all() in __iter__() prevents a duplicate query when choices are
 cast to a list and there's a prefetch_related().
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29158#comment:3>
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.b4e58e5db7770d953ba3cbaa5b1d2286%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to