support creating edit with clips
This commit is contained in:
parent
f95fc3db6e
commit
0e71ada256
1 changed files with 10 additions and 0 deletions
|
@ -249,6 +249,16 @@ def addEdit(request):
|
||||||
edit.edit(data, request.user)
|
edit.edit(data, request.user)
|
||||||
else:
|
else:
|
||||||
edit.save()
|
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':
|
if edit.status == 'featured':
|
||||||
pos, created = models.Position.objects.get_or_create(edit=edit,
|
pos, created = models.Position.objects.get_or_create(edit=edit,
|
||||||
user=request.user, section='featured')
|
user=request.user, section='featured')
|
||||||
|
|
Loading…
Reference in a new issue