Opened 15 years ago
Closed 11 years ago
#15654 closed Bug (wontfix)
qs.delete() fails if a model isn't in INSTALED_APPS and the related objects cache is already filled.
| Reported by: | Florian Apolloner | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
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.
Attachments (1)
Change History (8)
comment:1 by , 15 years ago
by , 15 years ago
comment:2 by , 15 years ago
| Type: | → Bug |
|---|
comment:3 by , 15 years ago
| Severity: | → Normal |
|---|
comment:4 by , 15 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:7 by , 11 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
After the app loading refactor, you aren't allowed to import models that aren't in an installed application.
Ups, diff got lost, but it's in this paste: http://paste.pocoo.org/show/356446/