wrap adding many clips in transaction, should be faster

This commit is contained in:
j 2014-02-09 11:30:40 +00:00
parent 545710528e
commit 58e787efd7

View file

@ -48,6 +48,7 @@ def addClips(request):
clips = []
if edit.editable(request.user):
index = data.get('index', edit.clips.count())
with transaction.commit_on_success():
for c in data['clips']:
clip = edit.add_clip(c, index)
index += 1
@ -253,6 +254,7 @@ def addEdit(request):
if 'clips' in data and edit.type == 'static':
index = 0
with transaction.commit_on_success():
for c in data['clips']:
clip = edit.add_clip(c, index)
index += 1