From 3999817cc95bb8eecf8c0d00d7fd5befb062c554 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Wed, 4 Mar 2020 09:05:35 +0000 Subject: [PATCH] Handle missing institution labels. --- app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 5dd3749..bf80478 100755 --- a/app.py +++ b/app.py @@ -349,11 +349,11 @@ def get_institution(entity, other): if 'P276' in entity['claims']: location = wikibase.first_datavalue(entity, 'P276') if location: - return other[location['id']] + return other.get(location['id']) if 'P195' in entity['claims']: collection = wikibase.first_datavalue(entity, 'P195') if collection: - return other[collection['id']] + return other.get(collection['id']) @app.route("/item/Q") def item_page(item_id):