Re: [Django] #33586: Cannot delete object (A) referenced by another object (B) if said object (A) has a foreign key to a custom user. (was: Cannot delete object (A) referenced by another object (B) if said object (A) has a foreign key to a custom User model)

8 views
Skip to first unread message

Django

unread,
Mar 21, 2022, 1:47:27 AM3/21/22
to django-...@googlegroups.com
#33586: Cannot delete object (A) referenced by another object (B) if said object
(A) has a foreign key to a custom user.
-------------------------------+------------------------------------
Reporter: Jeremy Poulin | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.0
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
-------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* stage: Unreviewed => Accepted


Comment:

Thanks for the detailed report. I was able to reproduce this issue.

It seems that `check_rel_lookup_compatibility(model, target_opts, field)`
fails because `target_opts` doesn't contain a reverse descriptor `b_set`.

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

Reply all
Reply to author
Forward
0 new messages