diff --git a/pandora/home/models.py b/pandora/home/models.py index 5409adfa..99ef744d 100644 --- a/pandora/home/models.py +++ b/pandora/home/models.py @@ -47,7 +47,7 @@ class Item(models.Model): if not isinstance(data[key], string_types): return False self.data[key] = data[key] - if key == 'contentid': + if key == 'contentid' and self.data[key]: content = self.get_content() if not content: return False diff --git a/pandora/home/views.py b/pandora/home/views.py index 07a795eb..49b405ad 100644 --- a/pandora/home/views.py +++ b/pandora/home/views.py @@ -54,7 +54,7 @@ def editHomeItem(request, data): response = json_response(status=500, text='failed to edit item') else: response['data'] = item.json() - add_changelog(request, data, item.get_id()) + add_changelog(request, data) return render_to_json_response(response) actions.register(editHomeItem, cache=False) @@ -70,7 +70,7 @@ def removeHomeItem(request, data): ''' item = get_object_or_404_json(models.Item, id=ox.fromAZ(data['id'])) item.delete() - add_changelog(request, data, item.get_id()) + add_changelog(request, data) response = json_response() return render_to_json_response(response) actions.register(removeHomeItem, cache=False)