lint code
This commit is contained in:
@@ -147,7 +147,9 @@ class DatabaseManager:
|
|||||||
migrations_run.append("region")
|
migrations_run.append("region")
|
||||||
|
|
||||||
if "region_name" not in columns:
|
if "region_name" not in columns:
|
||||||
cursor.execute("ALTER TABLE ip_stats ADD COLUMN region_name VARCHAR(100)")
|
cursor.execute(
|
||||||
|
"ALTER TABLE ip_stats ADD COLUMN region_name VARCHAR(100)"
|
||||||
|
)
|
||||||
migrations_run.append("region_name")
|
migrations_run.append("region_name")
|
||||||
|
|
||||||
if "timezone" not in columns:
|
if "timezone" not in columns:
|
||||||
|
|||||||
@@ -41,7 +41,9 @@ def fetch_ip_geolocation(ip_address: str) -> Optional[Dict[str, Any]]:
|
|||||||
|
|
||||||
# Check if the API call was successful
|
# Check if the API call was successful
|
||||||
if data.get("status") != "success":
|
if data.get("status") != "success":
|
||||||
app_logger.warning(f"IP lookup failed for {ip_address}: {data.get('message')}")
|
app_logger.warning(
|
||||||
|
f"IP lookup failed for {ip_address}: {data.get('message')}"
|
||||||
|
)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Cache the result
|
# Cache the result
|
||||||
|
|||||||
@@ -69,7 +69,9 @@ def main():
|
|||||||
sanitized_city = sanitize_for_storage(city, 100) if city else None
|
sanitized_city = sanitize_for_storage(city, 100) if city else None
|
||||||
sanitized_timezone = sanitize_for_storage(timezone, 50)
|
sanitized_timezone = sanitize_for_storage(timezone, 50)
|
||||||
sanitized_isp = sanitize_for_storage(isp, 100)
|
sanitized_isp = sanitize_for_storage(isp, 100)
|
||||||
sanitized_reverse = sanitize_for_storage(reverse, 255) if reverse else None
|
sanitized_reverse = (
|
||||||
|
sanitize_for_storage(reverse, 255) if reverse else None
|
||||||
|
)
|
||||||
sanitized_list_on = sanitize_dict(list_on, 100000)
|
sanitized_list_on = sanitize_dict(list_on, 100000)
|
||||||
|
|
||||||
db_manager.update_ip_rep_infos(
|
db_manager.update_ip_rep_infos(
|
||||||
|
|||||||
Reference in New Issue
Block a user