From 80a242ee49014e571563665e5d8c403ba9c9ccf6 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 25 Sep 2012 12:24:01 +0200 Subject: [PATCH] only update annotations if public_id really changed --- pandora/item/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 13af1f0f..198024ec 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -366,8 +366,10 @@ class Item(models.Model): for c in self.clips.all(): c.save() for a in self.annotations.all(): public_id = a.public_id.split('/')[1] - a.public_id = "%s/%s" % (self.itemId, public_id) - a.save() + public_id = "%s/%s" % (self.itemId, public_id) + if public_id != a.public_id: + a.public_id = public_id + a.save() tasks.update_file_paths.delay(self.itemId) if update_poster: return tasks.update_poster.delay(self.itemId)