#12339: ContentType update could cascade deletes to generic foreign keys, 
causing
data loss
------------------------------------------+---------------------------------
 Reporter:  kcarnold                      |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Contrib apps                  |     Version:  1.1       
 Keywords:  contenttype, delete, cascade  |       Stage:  Unreviewed
Has_patch:  0                             |  
------------------------------------------+---------------------------------
 Imagine that you change the name of a model.
 contrib/contenttypes/management.py has logic to remove unused content
 types. It does this by calling {{{ct.delete()}}}. The delete will cascade
 to any other models that reference that {{{ContentType}}}. If you have
 generic foreign key, this could cause any items that referred to the old
 table to get deleted. At least you lose the admin log, which could be
 valuable audit data; you could also lose any data (like votes) that
 applied to the old object that you haven't yet ported over -- and unless
 you're running syncdb doubly verbose, you'd never notice.

 I hope this bug is invalid and the delete doesn't actually cascade, or
 something makes sure things are never deleted first. But I noticed this
 because of a Postgres {{{IntegrityError}}} upon that hook trying to delete
 a {{{ContentType}}} that was still referenced by the admin log. I don't
 recall the exact error text, but what I Googled was "django_content_type
 still referenced".

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12339>
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.


Reply via email to