update item sort after adding document to item, fixes #2153

This commit is contained in:
j 2014-02-03 08:54:37 +00:00
parent 831d3a68f7
commit 3c1d3bbcb2

View file

@ -84,6 +84,7 @@ class Document(models.Model):
p.index = ItemProperties.objects.filter(item=item).aggregate(Max('index'))['index__max'] + 1 p.index = ItemProperties.objects.filter(item=item).aggregate(Max('index'))['index__max'] + 1
p.save() p.save()
p.document.update_matches() p.document.update_matches()
item.update_sort()
def remove(self, item): def remove(self, item):
ItemProperties.objects.filter(item=item, document=self).delete() ItemProperties.objects.filter(item=item, document=self).delete()