mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36: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,7 +59,6 @@ def login():
|
||||||
session['ui_language'] = user.interface_language
|
session['ui_language'] = user.interface_language
|
||||||
current_user.last_seen = utcnow()
|
current_user.last_seen = utcnow()
|
||||||
current_user.ip_address = ip_address()
|
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)
|
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
|
current_user.ip_address_country = ip_address_info['country'] if ip_address_info else current_user.ip_address_country
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
Loading…
Add table
Reference in a new issue