From 462a80967cf43c62b8d88848e68b20c3a8d3a9ca Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Thu, 1 Aug 2024 16:29:09 +0800 Subject: [PATCH] look up new account country by IP address - check on login --- app/auth/routes.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/auth/routes.py b/app/auth/routes.py index ff0c4c0d..73075105 100644 --- a/app/auth/routes.py +++ b/app/auth/routes.py @@ -59,9 +59,8 @@ def login(): session['ui_language'] = user.interface_language current_user.last_seen = utcnow() current_user.ip_address = ip_address() - if current_user.ip_address_country is None or current_user.ip_address_country == '': - ip_address_info = ip2location(current_user.ip_address) - current_user.ip_address_country = ip_address_info['country'] if ip_address_info else current_user.ip_address_country + ip_address_info = ip2location(current_user.ip_address) + current_user.ip_address_country = ip_address_info['country'] if ip_address_info else current_user.ip_address_country db.session.commit() next_page = request.args.get('next') if not next_page or url_parse(next_page).netloc != '':