From 9c28041171a1ffcfa3bf9e8f22e074bfc03f98b3 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 18 Dec 2014 17:39:48 +0000 Subject: [PATCH] fix edit call (changelog) --- pandora/item/models.py | 1 + pandora/item/views.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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)