qs.delete() fails if a model isn't in INSTALED_APPS and the related objects cache is already filled.
|Reported by:||apollo13||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
ContentType.objects.delete() fails for use since 1.3 (on_delete support to be exact) since it tries to delete all related objects pointing to that contenttype. If one of the related models is not in INSTALLED_APPS (in our case django.contrib.auth), this can fail if the model got imported (which registers it etc…; in our case django.contrib.contenttypes.generic imported auth.models -- via contrib.admin). Attached is a testcase showcasing the issue.
Change History (7)
comment:1 Changed 3 years ago by apollo13
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset