From 39b2a3c469623eae5b3189e77a61f6168fe42e97 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 14 May 2023 14:23:37 +0000 Subject: [PATCH] Remove duplicate code. --- web_view.py | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/web_view.py b/web_view.py index 6a11554..318b9c7 100755 --- a/web_view.py +++ b/web_view.py @@ -389,36 +389,6 @@ def lookup_item(item_id): return redirect(url) -@app.route("/item/Q") -def lookup_item(item_id): - item = api.get_item(item_id) - if not item: - # TODO: show nicer page for Wikidata item not found - return abort(404) - - try: - lat, lon = item.locations[0].get_lat_lon() - except IndexError: - # TODO: show nicer page for Wikidata item without coordinates - return abort(404) - - return render_template( - "map.html", - active_tab="map", - zoom=16, - lat=lat, - lon=lon, - username=get_username(), - mode="map", - q=None, - qid=item.qid, - item_type_filter=[], - ) - - url = url_for("map_location", zoom=16, lat=lat, lon=lon, item=item.qid) - return redirect(url) - - @app.route("/search/map") def search_map_page(): user_lat, user_lon = get_user_location() or (None, None)