Optimize the naming of setting params (#410)

This commit is contained in:
Wu Clan
2024-09-09 11:50:22 +08:00
committed by GitHub
parent 9aa2d7b593
commit b13410c7d1
14 changed files with 96 additions and 97 deletions
+2 -2
View File
@@ -83,9 +83,9 @@ async def parse_ip_info(request: Request) -> IpInfo:
if location:
country, region, city = location.split(' ')
return IpInfo(ip=ip, country=country, region=region, city=city)
if settings.LOCATION_PARSE == 'online':
if settings.IP_LOCATION_PARSE == 'online':
location_info = await get_location_online(ip, request.headers.get('User-Agent'))
elif settings.LOCATION_PARSE == 'offline':
elif settings.IP_LOCATION_PARSE == 'offline':
location_info = await get_location_offline(ip)
else:
location_info = None