From f7ee92369b09758f3cfa4bc5fd6554869a6ceee7 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 10 Nov 2011 21:00:57 +0100 Subject: [PATCH] times access should be 0 not None --- pandora/item/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora/item/models.py b/pandora/item/models.py index 9746e94e..479eabaf 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -714,6 +714,8 @@ class Item(models.Model): s.cutsperminute = None s.wordsperminute = None s.timesaccessed = self.accessed.aggregate(Sum('accessed'))['accessed__sum'] + if not s.timesaccessed: + s.timesaccessed = 0 s.save() #update cached values in clips self.clips.all().update(director=s.director, title=s.title)