mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
look up new account country by IP address - check on login
This commit is contained in:
parent
c31d7c187c
commit
462a80967c
1 changed files with 2 additions and 3 deletions
|
@ -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 != '':
|
||||
|
|
Loading…
Reference in a new issue