From d2f04319a521d3f74a1a687096644f29de23b23c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 19 Mar 2013 14:04:03 +0000 Subject: [PATCH] make moving files more reliable --- pandora/item/models.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 6ff33a9cf..efca1f9bb 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -409,11 +409,9 @@ class Item(models.Model): l.remove(self) if l.items.filter(id=other.id).count() == 0: l.add(other) - #FIXME: should this really happen for annotations? - for a in self.annotations.all(): - a.item = other - a.public_id = None - a.save() + self.annotations.all().update(item=other, public_id=None) + for a in other.annotations.filter(public_id=None).order_by('id'): + a.set_public_id() if hasattr(self, 'files'): for f in self.files.all():