From f3d20abe99d5877e233d2136d34282d513f9c75e Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 15 Feb 2012 22:03:19 +0530 Subject: [PATCH] remove clips without annotations --- pandora/annotation/tasks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora/annotation/tasks.py b/pandora/annotation/tasks.py index 0f395504..319c7fb0 100644 --- a/pandora/annotation/tasks.py +++ b/pandora/annotation/tasks.py @@ -49,7 +49,10 @@ def update_matching_places(id): @task(ignore_resulsts=True, queue='default') def update_item(id): from item.models import Item + from clip.models import Clip a = models.Annotation.objects.get(pk=id) + #cleanup orphaned clips + Clip.objects.filter(annotations__id=None).delete() #update facets if needed if filter(lambda f: f['id'] == a.layer, settings.CONFIG['filters']): a.item.update_layer_facet(a.layer)