[Bugfix] for login ip

This commit is contained in:
ibuler
2018-01-16 11:08:05 +08:00
parent 29061aa088
commit 681ddb5af2
3 changed files with 3 additions and 2 deletions

View File

@@ -180,6 +180,7 @@ def validate_ip(ip):
def write_login_log(username, type='', ip='', user_agent=''):
if not (ip and validate_ip(ip)):
ip = ip[:15]
city = "Unknown"
else:
city = get_ip_city(ip)