#30330: delete() on instances of models without any dependencies doesn't clear 
PKs.
-------------------------------------+-------------------------------------
     Reporter:  Artur                |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  2.2
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:  delete, pk           |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Florian Apolloner):

 I have attached a simple fix which mimics what
 
https://github.com/django/django/blob/master/django/db/models/deletion.py#L324-L326
 does for multiple objects. I am not sure if we need
 
https://github.com/django/django/blob/master/django/db/models/deletion.py#L320-L323
 (the block above) because I think `field_updates` is only ever filled if
 the objects are not fast-deletable -- ie
 https://github.com/django/django/blob/master/django/db/models/deletion.py#L224
 is not called due to the `can_fast_delete` check at the beginning of the
 `collect` function.

 That said, if we want to be extra "safe" we can just move lines 320 - 326
 into an extra function and call that from the old and new location (though
 I do not think it is needed).

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

Reply via email to