mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-01-15 14:47:24 +00:00
perf: Improve city retrieval fallback to handle missing values
This commit is contained in:
@@ -101,7 +101,7 @@ def get_ip_city(ip):
|
||||
|
||||
info = get_ip_city_by_ipip(ip)
|
||||
if info:
|
||||
city = info.get('city', _("Unknown"))
|
||||
city = info.get('city') or _("Unknown")
|
||||
country = info.get('country')
|
||||
|
||||
# 国内城市 并且 语言是中文就使用国内
|
||||
|
||||
Reference in New Issue
Block a user