From dd49b61a59a4cbf51dba8936fed77aac3235a2eb Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 12 May 2013 14:20:55 +0200 Subject: [PATCH] set words/clips only if id exists --- pandora/item/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index d359d7e7d..566942fff 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -811,8 +811,9 @@ class Item(models.Model): s.rightslevel = self.level s.aspectratio = self.get('aspectratio') - s.words = sum([len(a.value.split()) for a in self.annotations.exclude(value='')]) - s.clips = self.clips.count() + if self.id: + s.words = sum([len(a.value.split()) for a in self.annotations.exclude(value='')]) + s.clips = self.clips.count() videos = self.files.filter(selected=True).filter(Q(is_video=True)|Q(is_audio=True)) if videos.count() > 0: