times access should be 0 not None

This commit is contained in:
j 2011-11-10 21:00:57 +01:00
parent ba2dd341d3
commit f7ee92369b

View file

@ -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)