Development

This commit is contained in:
Matthew Grotke 2026-05-24 02:09:53 -04:00
parent b5b3699590
commit 8ae6985503

View file

@ -4,7 +4,6 @@ import json, re, subprocess, os, sys, html as html_mod
import sanitize
import validation as validate
from datetime import datetime, timezone
from zoneinfo import ZoneInfo, ZoneInfoNotFoundError
from config_utils import core_hash, get_pending_entries, get_dashboard_pending, _seconds_until_next_run, _format_timing, _is_locked, _lock_mtime, WEB_APP_DISPLAY_NAME, CONFIGS_DIR, DATA_DIR
bp = Blueprint('view_page', __name__)
@ -431,12 +430,7 @@ def _blocklist_stats_html(core):
entries = sum(1 for _ in f)
mtime = int(os.path.getmtime(bl_path))
size_str = _fmt_bytes(os.path.getsize(bl_path))
tz_name = session.get('timezone', '')
try:
tz = ZoneInfo(tz_name) if tz_name else timezone.utc
except ZoneInfoNotFoundError:
tz = timezone.utc
last_refreshed = f'{datetime.fromtimestamp(mtime, tz=tz).strftime("%Y-%m-%d %H:%M")} ({_relative_time(mtime)})'
last_refreshed = f'{datetime.fromtimestamp(mtime).strftime("%Y-%m-%d %H:%M")} ({_relative_time(mtime)})'
except Exception:
entries, size_str, last_refreshed = '-', '-', 'Never'
rows += (f'<tr>'