diff --git a/pandora/item/models.py b/pandora/item/models.py index 212ffcc97..54edcb060 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -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 diff --git a/pandora/item/views.py b/pandora/item/views.py index b95397d48..166ed517d 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -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)