﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25883	Admin Delete Page Incorrectly Counts Related Objects	James Pulec	Sergey Fedoseev	"In the case where we're deleting an object (A) that has dependent foreign object (B) that points to it, and a different dependent foreign object (C) that also has B as a dependent foreign object, the admin will incorrectly double count this object. As an example:

{{{
class Spam(models.Model):
  pass

class Egg(models.Model):
  spam = ForeignKey(Spam)

class Shrubbery(models.Model):
  spam = ForeignKey(Spam)
  egg = ForeignKey(Egg)

spam = Spam.objects.create()
egg = Egg.objects.create(spam=spam)
shrubbery = Shrubbery.objects.create(spam=spam, egg=egg)
}}}

If we issue a delete on an instance of Spam in this case, the admin will state that we are deleting 2 instances of Shrubbery, even though we are really only deleting 1 instance of Shrubbery that is attached both directly to the instance of Spam, and to the instance of Egg that is a dependent object of spam."	Bug	closed	contrib.admin	1.9	Normal	fixed			Accepted	1	0	0	0	0	0
