aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 = "-"