mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-11-02 06:53:37 +00:00
perf: 修改 asset 结构
This commit is contained in:
@@ -36,13 +36,13 @@ def write_content_to_excel(response, header=None, login_logs=None, fields=None):
|
||||
def write_login_log(*args, **kwargs):
|
||||
from audits.models import UserLoginLog
|
||||
|
||||
ip = kwargs.get('ip') or ''
|
||||
ip = kwargs.get('address') or ''
|
||||
if not (ip and validate_ip(ip)):
|
||||
ip = ip[:15]
|
||||
city = DEFAULT_CITY
|
||||
else:
|
||||
city = get_ip_city(ip) or DEFAULT_CITY
|
||||
kwargs.update({'ip': ip, 'city': city})
|
||||
kwargs.update({'address': ip, 'city': city})
|
||||
UserLoginLog.objects.create(**kwargs)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user