from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
-import uvicorn
import requests
+import uvicorn
from fba import database
from fba import utils
found = 0
blocklist = list()
- if response is not None and response.ok and response.status_code >= 300 and len(response.text) > 0:
+ if response.ok and response.status_code == 200 and len(response.text) > 0:
blocklist = response.json()
format = config.get("timestamp_format")
for block_level in blocklist:
for row in blocklist[block_level]:
row["first_seen"] = datetime.utcfromtimestamp(row["first_seen"]).strftime(format)
- row["last_seen"] = datetime.utcfromtimestamp(row["last_seen"]).strftime(format) if isinstance(row["last_updated"], float) else None
+ row["last_seen"] = datetime.utcfromtimestamp(row["last_seen"]).strftime(format) if isinstance(row["last_seen"], float) else None
found = found + 1
return templates.TemplateResponse("views/top.html", {