aboutsummaryrefslogtreecommitdiff
path: root/app/util
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-11-03 16:28:03 -0600
committerParker <contact@pkrm.dev>2024-11-03 16:28:03 -0600
commitde4dc0bc5b0196f09bb134df5374d169cc02b426 (patch)
tree0df51490e02791132ab80c0e497fd25aba46c7b3 /app/util
parent3403057f2538630f764eb1e7557dccc55427648c (diff)
"TRUE" -> True - Stupid issue (String v Boolean)
Diffstat (limited to 'app/util')
-rw-r--r--app/util/log.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/util/log.py b/app/util/log.py
index e49080f..2b3542b 100644
--- a/app/util/log.py
+++ b/app/util/log.py
@@ -20,10 +20,12 @@ def log(link, ip, user_agent):
# Get the redirect link and owner of the link
redirect_link, owner = (
- db.query(Link.redirect_link, Link.owner).filter(Link.link == link).first()
+ db.query(Link.redirect_link, Link.owner)
+ .filter(Link.link == link)
+ .first()
)
- if IP_TO_LOCATION == "TRUE":
+ if IP_TO_LOCATION:
# Get IP to GEO via IP2Location.io
try:
data = ipgeolocation.lookup(ip)
@@ -32,7 +34,8 @@ def log(link, ip, user_agent):
# Fatal error, API key is invalid or out of requests, quit
except IP2LocationIOAPIError:
LOG.error(
- "Invalid API key or insufficient credits. Change the `config.ini` file if you no longer need the IP2Location API feature."
+ "Invalid API key or insufficient credits. Change the"
+ " `config.ini` file if you no longer need IP geolocation."
)
location = "-, -"
isp = "-"