really fix.
This commit is contained in:
parent
8a90bf5e3f
commit
1a7872b136
12
app.py
12
app.py
|
@ -316,11 +316,13 @@ def existing_depicts_from_entity(entity):
|
||||||
|
|
||||||
def get_institution(entity, other):
|
def get_institution(entity, other):
|
||||||
if 'P276' in entity['claims']:
|
if 'P276' in entity['claims']:
|
||||||
location = wikibase.first_datavalue(entity, 'P276')['id']
|
location = wikibase.first_datavalue(entity, 'P276')
|
||||||
return other[location]
|
if location:
|
||||||
elif 'P195' in entity['claims']:
|
return other[location['id']]
|
||||||
collection = wikibase.first_datavalue(entity, 'P195')['id']
|
if 'P195' in entity['claims']:
|
||||||
return other[collection]
|
collection = wikibase.first_datavalue(entity, 'P195')
|
||||||
|
if collection:
|
||||||
|
return other[collection['id']]
|
||||||
|
|
||||||
@app.route("/item/Q<int:item_id>")
|
@app.route("/item/Q<int:item_id>")
|
||||||
def item_page(item_id):
|
def item_page(item_id):
|
||||||
|
|
Loading…
Reference in a new issue