Handle 'unknown value' in depicts statement

Closes: #30
This commit is contained in:
Edward Betts 2020-06-30 13:21:32 +01:00
parent dc4455bec5
commit 98d84054d6

3
app.py
View file

@ -361,6 +361,9 @@ def existing_depicts_from_entity(entity):
existing = []
new_depicts = False
for claim in entity['claims']['P180']:
if 'datavalue' not in claim['mainsnak']:
continue
item_id = claim['mainsnak']['datavalue']['value']['numeric-id']
item = DepictsItem.query.get(item_id)