Jens Ådne Rydland
unread,Nov 5, 2012, 9:30:55 AM11/5/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-d...@googlegroups.com
Not really sure what to use as subject here, or whether this qualifies
to be called a bug, but I don't think it belongs on django-users due to
being an issue in Django itself so I figured I'd ask here before opening
a ticket.
So, we have a project that doesn't use contrib.auth, and it doesn't use
contrib.admin, it does, however, use contrib.contenttypes.generic. And
c.c.generic imports InlineModelAdmin and flatten_fieldsets from
contrib.admin.options, which does some more imports which down the line
causes various models to be imported from contrib.auth.models, and this
in turn causes the auth models to be registered in AppCache, and thus to
be found by db.models.Options' get_all_related_objects() which is used
by db.models.deletion.Collector.collect().
This hasn't caused us any trouble so far, but now that we needed to
delete some stale ContentTypes we suddenly got weird crashes related to
contrib.auth tables not existing when delete() tried to find foreign
keys pointing to ContentType.
I've tested moving the admin related bits from contenttypes/generic.py
to contenttypes/admin.py, which seems to have fixed our immediate
problem, but haven't really tested if it breaks anything else. And I
guess this could be considered a too obscure corner case to care about,
but would appreciate some feedback anyway.
--
Jens Ådne Rydland