Opened 14 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)

test.diff (1.7 KB ) - added by Florian Apolloner 14 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by Florian Apolloner, 14 years ago

Ups, diff got lost, but it's in this paste: http://paste.pocoo.org/show/356446/

by Florian Apolloner, 14 years ago

Attachment: test.diff added

comment:2 by Luke Plant, 14 years ago

Type: Bug

comment:3 by Luke Plant, 14 years ago

Severity: Normal

comment:4 by Jacob, 14 years ago

Triage Stage: UnreviewedAccepted

comment:5 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:6 by Aymeric Augustin, 13 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:7 by Aymeric Augustin, 11 years ago

Resolution: wontfix
Status: newclosed

After the app loading refactor, you aren't allowed to import models that aren't in an installed application.

Note: See TracTickets for help on using tickets.
Back to Top