dont try to sort smart lists.

This commit is contained in:
j 2014-02-05 13:30:54 +00:00
parent b2b2649420
commit f8ba4ed48f

View file

@ -142,11 +142,14 @@ def orderClips(request):
response = json_response() response = json_response()
ids = map(ox.fromAZ, data['ids']) ids = map(ox.fromAZ, data['ids'])
if edit.editable(request.user): if edit.editable(request.user):
index = 0 if edit.type == 'static':
with transaction.commit_on_success(): index = 0
for i in ids: with transaction.commit_on_success():
models.Clip.objects.filter(edit=edit, id=i).update(index=index) for i in ids:
index += 1 models.Clip.objects.filter(edit=edit, id=i).update(index=index)
index += 1
else:
response = json_response(status=500, text='sorting smart lists not possible')
else: else:
response = json_response(status=403, text='permission denied') response = json_response(status=403, text='permission denied')
return render_to_json_response(response) return render_to_json_response(response)