From bb563c1d82d8e1be9ddb804ee2e47a609ad588b0 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 13 Nov 2018 12:06:24 +0000 Subject: [PATCH] dereference annotation --- pandora/edit/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandora/edit/views.py b/pandora/edit/views.py index 12d623c0..57abed30 100644 --- a/pandora/edit/views.py +++ b/pandora/edit/views.py @@ -118,6 +118,12 @@ def editClip(request, data): clip.item = clip.annotation.item clip.annotation = None setattr(clip, {'in': 'start', 'out': 'end'}.get(key), float(data[key])) + if 'annotation' in data and not data['annotation']: + if clip.annotation: + clip.start = clip.annotation.start + clip.end = clip.annotation.end + clip.item = clip.annotation.item + clip.annotation = None if 'volume' in data: clip.volume = float(data['volume']) if not clip.annotation: