#32682: Deleting objects after searching related many to many field crashes the
admin page
-------------------------------------+-------------------------------------
     Reporter:  Zain Patel           |                    Owner:  Mariusz
                                     |  Felisiak
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.admin        |                  Version:  3.2
     Severity:  Release blocker      |               Resolution:  fixed
     Keywords:  regression, admin,   |             Triage Stage:  Accepted
  delete                             |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

 In [changeset:"28e2077148f7602d29165e90965974698819cbba" 28e20771]:
 {{{
 #!CommitTicketReference repository=""
 revision="28e2077148f7602d29165e90965974698819cbba"
 Refs #32433 -- Reallowed calling QuerySet.delete() after distinct().

 While values(*field_excluding_pk).distinct() and
 distinct(*field_excluding_pk) can reduce the number of resulting rows
 in a way that makes subsequent delete() calls ambiguous standalone
 .distinct() calls cannot.

 Since delete() already disallows chain usages with values() the only
 case that needs to be handled, as originally reported, is when
 DISTINCT ON is used via distinct(*fields).

 Refs #32682 which had to resort to subqueries to prevent duplicates in
 the admin and caused significant performance regressions on MySQL
 (refs #34639).

 This partly reverts 6307c3f1a123f5975c73b231e8ac4f115fd72c0d.
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32682#comment:10>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701892ee0c094-055054ff-7ac6-43ab-8587-60c37714ac7d-000000%40eu-central-1.amazonses.com.

Reply via email to