Don't try to set label for new item during save.

This commit is contained in:
Edward Betts 2020-03-03 15:20:04 +00:00
parent 0aac0e46be
commit 3e551d89d9

3
app.py
View file

@ -134,8 +134,7 @@ def save(item_id):
artwork_item = Item.query.get(item_id) artwork_item = Item.query.get(item_id)
if artwork_item is None: if artwork_item is None:
artwork_entity = mediawiki.get_entity_with_cache(f'Q{item_id}') artwork_entity = mediawiki.get_entity_with_cache(f'Q{item_id}')
label = wikibase.get_entity_label(artwork_entity) artwork_item = Item(item_id=item_id, entity=artwork_entity)
artwork_item = Item(item_id=item_id, label=label, entity=artwork_entity)
database.session.add(artwork_item) database.session.add(artwork_item)
database.session.commit() database.session.commit()