create clips for all annotations

This commit is contained in:
j 2014-11-17 16:56:30 +00:00
parent cffbde5f5c
commit 25d794e803

View file

@ -158,12 +158,8 @@ class Annotation(models.Model):
self.sortvalue = None self.sortvalue = None
self.languages = None self.languages = None
#no clip or update clip
if self.layer in settings.CONFIG.get('clipLayers', []):
if not self.clip or self.start != self.clip.start or self.end != self.clip.end: if not self.clip or self.start != self.clip.start or self.end != self.clip.end:
self.clip, created = Clip.get_or_create(self.item, self.start, self.end) self.clip, created = Clip.get_or_create(self.item, self.start, self.end)
elif self.clip:
self.clip = None
super(Annotation, self).save(*args, **kwargs) super(Annotation, self).save(*args, **kwargs)
if set_public_id: if set_public_id: