From e3d825c48f626a401649c47ac6e04dc53b553192 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 16 Nov 2021 12:22:17 +0000 Subject: [PATCH] Fix user location crash --- web_view.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web_view.py b/web_view.py index 6fee4d2..c20df04 100755 --- a/web_view.py +++ b/web_view.py @@ -113,10 +113,8 @@ def geoip_user_record(): def get_user_location(): remote_ip = request.args.get('ip', request.remote_addr) - return maxminddb_reader.get(remote_ip)["location"] - - gir = geoip_user_record() - return (gir["latitude"], gir["longitude"]) if gir else None + maxmind = maxminddb_reader.get(remote_ip)["location"] + return maxmind["location"] if maxmind else None @app.route("/")