fix edit call (changelog)

This commit is contained in:
j 2014-12-18 17:39:48 +00:00
parent 8fd99ac1be
commit 9c28041171
2 changed files with 2 additions and 1 deletions

View File

@ -228,6 +228,7 @@ class Item(models.Model):
return False
def edit(self, data):
data = data.copy()
#FIXME: how to map the keys to the right place to write them to?
if 'id' in data:
#FIXME: check if id is valid and exists and move/merge items accordingly

View File

@ -545,13 +545,13 @@ def edit(request, data):
user_groups = set([g.name for g in request.user.groups.all()])
other_groups = list(groups - user_groups)
data['groups'] = [g for g in data['groups'] if g in user_groups] + other_groups
add_changelog(request, data)
r = item.edit(data)
if r:
r.wait()
if update_clips:
tasks.update_clips.delay(item.public_id)
response['data'] = item.get_json()
add_changelog(request, data)
else:
response = json_response(status=403, text='permission denied')
return render_to_json_response(response)