set words/clips only if id exists
This commit is contained in:
parent
f0acbd2bef
commit
dd49b61a59
1 changed files with 3 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue