diff --git a/pandora/annotation/models.py b/pandora/annotation/models.py index 3b572cb8a..45e91dfd8 100644 --- a/pandora/annotation/models.py +++ b/pandora/annotation/models.py @@ -161,9 +161,6 @@ class Annotation(models.Model): if layer.get('type') == 'event' or layer.get('hasEvents'): update_matching_events(self.id) - #update sort/find tables async - update_item.delay(self.id) - def delete(self, *args, **kwargs): super(Annotation, self).delete(*args, **kwargs) if self.clip.annotations.count() == 0: diff --git a/pandora/annotation/views.py b/pandora/annotation/views.py index a59d800e1..38dfba126 100644 --- a/pandora/annotation/views.py +++ b/pandora/annotation/views.py @@ -17,7 +17,7 @@ from item import utils from item.models import Item import models - +from tasks import update_item def parse_query(data, user): query = {} @@ -200,6 +200,8 @@ def editAnnotation(request): 'out': 'end' }.get(key,key), data[key]) a.save() + #update sort/find tables async + update_item.delay(a.id) response['data'] = a.json() response['data']['editable'] = True else: diff --git a/pandora/item/management/commands/update_external.py b/pandora/item/management/commands/update_external.py index 04070ebb1..b68b3790c 100644 --- a/pandora/item/management/commands/update_external.py +++ b/pandora/item/management/commands/update_external.py @@ -2,11 +2,7 @@ # vi:si:et:sw=4:sts=4:ts=4 from optparse import make_option -import os -from os.path import join, dirname, basename, splitext, exists - -from django.core.management.base import BaseCommand, CommandError -from django.conf import settings +from django.core.management.base import BaseCommand import monkey_patch.models from ... import models diff --git a/pandora/item/models.py b/pandora/item/models.py index 27a13c980..e2f44df8a 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1255,7 +1255,6 @@ class Item(models.Model): offset += f.duration #remove left over clips without annotations Clip.objects.filter(item=self, annotations__id=None).delete() - self.update_find() def srt(self, layer): return ox.srt.encode([{ diff --git a/pandora/item/tasks.py b/pandora/item/tasks.py index 02fabd44f..273d24cdf 100644 --- a/pandora/item/tasks.py +++ b/pandora/item/tasks.py @@ -59,6 +59,9 @@ def update_timeline(itemId): def load_subtitles(itemId): item = models.Item.objects.get(itemId=itemId) item.load_subtitles() + item.update_find() + item.update_sort() + item.update_facets() @task(ignore_resulsts=True, queue='default') def update_sitemap(base_url):