perf: Improve city retrieval fallback to handle missing values

This commit is contained in:
wangruidong
2025-11-21 16:06:54 +08:00
committed by 老广
parent 636ffd786d
commit 978fbc70e6

View File

@@ -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')
# 国内城市 并且 语言是中文就使用国内