#12339: ContentType update could cascade deletes to generic foreign keys,
causing
data loss
-----------------------------------+----------------------------------------
Reporter: kcarnold | Owner: nobody
Status: reopened | Milestone:
Component: Contrib apps | Version: 1.1
Resolution: | Keywords: contenttype, delete,
cascade
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-----------------------------------+----------------------------------------
Comment (by kcarnold):
As far as I'm concerned, removing the "delete" line (keeping the verbose
note about stale content types) fixes this bug. The rest of this comment
is just about the extra next step, which is to restore convenience in the
cases where the previous behavior was desirable--though it might be better
to just wait until migrations are merged to do that.
If there were a way to tell that a {{{.delete()}}} would cascade before
you do it, like the admin does (race conditions aside), a confirmation
message might be: "{{{The model named %s (ContentType id %d) was removed,
but other objects refer to it. Do you want to delete those objects also?
[y/N] }}}" And of course there should be an option to proceed non-
interactively, which would just report the stale {{{ContentType}}} ids
without deleting them.
Do any tests delete models? If not, a confirmation shouldn't disrupt
tests.
btw, the code in question was added in [6287].
--
Ticket URL: <http://code.djangoproject.com/ticket/12339#comment:4>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.