From 0e71ada256a716bee7bb443247488b9291f278f9 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 7 Feb 2014 07:23:38 +0000 Subject: [PATCH] support creating edit with clips --- pandora/edit/views.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pandora/edit/views.py b/pandora/edit/views.py index e209f8da..3f2a7d6c 100644 --- a/pandora/edit/views.py +++ b/pandora/edit/views.py @@ -249,6 +249,16 @@ def addEdit(request): edit.edit(data, request.user) else: edit.save() + + if 'clips' in data and edit.type == 'static': + index = 0 + for c in data['clips']: + clip = edit.add_clip(c, index) + index += 1 + if not clip: + response = json_response(status=500, text='invalid in/out') + return render_to_json_response(response) + if edit.status == 'featured': pos, created = models.Position.objects.get_or_create(edit=edit, user=request.user, section='featured')