fix keeping items in list if id changes and it is merged with another item, fixes #1011

This commit is contained in:
j 2013-02-10 13:08:49 +00:00
parent 38954ef8bf
commit fa753f240c

View file

@ -410,7 +410,7 @@ class Item(models.Model):
''' '''
for l in self.lists.all(): for l in self.lists.all():
l.remove(self) l.remove(self)
if l.items.filter(id=other.id) == 0: if l.items.filter(id=other.id).count() == 0:
l.add(other) l.add(other)
#FIXME: should this really happen for annotations? #FIXME: should this really happen for annotations?
for a in self.annotations.all(): for a in self.annotations.all():