[Django] #31258: Django admin deletes only one instance from many

7 views
Skip to first unread message

Django

unread,
Feb 11, 2020, 3:29:26 AM2/11/20
to django-...@googlegroups.com
#31258: Django admin deletes only one instance from many
-----------------------------------------+------------------------
Reporter: Pavel-Y | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.2
Severity: Normal | Keywords: admin
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
This is my first bug report here, hope I don't mess things too much.

I have this model. I have plenty of instances with the same name, same
start_date and is_deleted=true. Also one instance with same name, same
start_date but is_deleted=false.

When I go to admin page, mark _all_ those where is_deleted==true and
delete them, I am asked if I am sure I want to delete. I answer Yes and I
am returned to the previous page, to the list of instances. However only
one of those instances is deleted.

I think it's a bug. I think all marked instances should be deleted.
Django 2.2.10, python 3.6.4

{{{
class Festival(models.Model):
name = models.CharField(max_length=100)
start_date = models.DateField(null=True)
is_deleted = models.BooleanField(default=False)

def __str__(self):
return self.name

def __lt__(self, rhs):
if self.start_date is None:
return False
if rhs.start_date is None:
return True
return (self.start_date < rhs.start_date
or self.start_date == rhs.start_date and self.name < rhs.name)

def __eq__(self, rhs):
return (self.start_date == rhs.start_date
and self.name == rhs.name
and self.is_deleted == rhs.is_deleted)

def __hash__(self):
return hash((self.name, self.start_date, self.is_deleted))

}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31258>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 11, 2020, 6:01:27 AM2/11/20
to django-...@googlegroups.com
#31258: Django admin deletes only one instance from many
-------------------------------+--------------------------------------
Reporter: Pavel-Y | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 2.2
Severity: Normal | Resolution: worksforme

Keywords: admin | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Carlton Gibson):

* status: new => closed
* resolution: => worksforme


Comment:

Hi Pavel.

Can you put together a minimal project demonstrating this issue please?

When I test as best I can from the description on a project it's all
working as expected, so maybe there's more info needed to reproduce?

I'll close as "worksforme" for now, but if you can provide a test project,
please do re-open.

Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/31258#comment:1>

Reply all
Reply to author
Forward
0 new messages