From fdd8b23118724f0650088449d953d90444027b43 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 30 Jun 2020 11:17:21 +0100 Subject: [PATCH] Follow redirects for artwork --- app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app.py b/app.py index eef62f2..61b4354 100755 --- a/app.py +++ b/app.py @@ -397,6 +397,10 @@ def item_page(item_id): from_redirect = qid in session and session.pop(qid) == 'from redirect' entity = mediawiki.get_entity_with_cache(qid, refresh=not from_redirect) + if 'redirects' in entity: + redirect_to_item_id = int(entity['redirects']['to'][1:]) + return redirect(url_for(request.endpoint, item_id=redirect_to_item_id)) + existing_depicts = existing_depicts_from_entity(entity) width = 800