From 390595a2617e02437aa0735c1f901949670274fb Mon Sep 17 00:00:00 2001 From: j Date: Thu, 26 Jan 2017 17:06:34 +0100 Subject: [PATCH] return current data --- pandora/home/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora/home/views.py b/pandora/home/views.py index c598ab3a4..0ea49307e 100644 --- a/pandora/home/views.py +++ b/pandora/home/views.py @@ -22,10 +22,11 @@ def addHomeItem(request, data): } ''' item = models.Item() + response = json_response() if not item.edit(data): response = json_response(status=500, text='invalid data') else: - response = json_response() + response['data'] = item.json() return render_to_json_response(response) actions.register(addHomeItem, cache=False) @@ -43,10 +44,11 @@ def editHomeItem(request, data): } ''' item = get_object_or_404_json(models.Item, id=ox.fromAZ(data['id'])) + response = json_response() if not item.edit(data): response = json_response(status=500, text='failed to edit item') else: - response = json_response() + response['data'] = item.json() return render_to_json_response(response) actions.register(editHomeItem, cache=False)