diff --git a/oml/item/api.py b/oml/item/api.py index c8c974d..a3a31a2 100644 --- a/oml/item/api.py +++ b/oml/item/api.py @@ -141,7 +141,7 @@ def edit(data): edited = [] for id in ids: item = models.Item.get(id) - if item and item.json()['mediastate'] == 'available': + if item and item.json().get('mediastate') == 'available': item.edit(data) response = item.json() edited.append(id)