From 0b6dafec62f22383bf501e1594d3b9a8c93f2337 Mon Sep 17 00:00:00 2001 From: Parker Date: Sun, 3 Nov 2024 21:29:10 -0600 Subject: Fix link redirects and remove BASE_URL --- app/util/log.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/util') diff --git a/app/util/log.py b/app/util/log.py index 943863d..6be82e7 100644 --- a/app/util/log.py +++ b/app/util/log.py @@ -4,10 +4,10 @@ from ua_parser import user_agent_parser from ip2locationio.ipgeolocation import IP2LocationIOAPIError from database import SessionLocal -from config import LOG, API_KEY, IP_TO_LOCATION +import config from models import Link, Record -configuration = ip2locationio.Configuration(API_KEY) +configuration = ip2locationio.Configuration(config.API_KEY) ipgeolocation = ip2locationio.IPGeolocation(configuration) """ @@ -25,7 +25,7 @@ def log(link, ip, user_agent): .first() ) - if IP_TO_LOCATION: + if config.IP_TO_LOCATION: # Get IP to GEO via IP2Location.io try: data = ipgeolocation.lookup(ip) @@ -33,7 +33,7 @@ def log(link, ip, user_agent): isp = data["as"] # Fatal error, API key is invalid or out of requests, quit except IP2LocationIOAPIError: - LOG.error( + config.LOG.error( "Invalid API key or insufficient credits. Change the" " `config.ini` file if you no longer need IP geolocation." ) -- cgit v1.2.3-70-g09d2