From 447b9574a3471f689af0bba65931feea2f9ac285 Mon Sep 17 00:00:00 2001 From: Andreas Wrede Date: Thu, 9 Jul 2026 17:52:02 -0400 Subject: [PATCH] fix: type annotations for mypy parity with master Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01NfPpSpccTWBfZg1FTveyaU --- hbd/server/http.py | 2 +- hbd/server/settings.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hbd/server/http.py b/hbd/server/http.py index ad805f7..ca3d0cf 100644 --- a/hbd/server/http.py +++ b/hbd/server/http.py @@ -40,7 +40,7 @@ def _build_threshold_configs_from_form(form_data: dict) -> dict: metrics = cfg.get("metrics") if not isinstance(metrics, dict): continue - thresholds = {} + thresholds: dict = {} for metric_path, values in metrics.items(): _insert_threshold_metric(thresholds, metric_path, values) entry = {"thresholds": thresholds} diff --git a/hbd/server/settings.py b/hbd/server/settings.py index 1e2541a..1286646 100644 --- a/hbd/server/settings.py +++ b/hbd/server/settings.py @@ -170,7 +170,7 @@ def get_settings_sections(config: dict, threshold_checker=None, user=None) -> li } """ is_admin = user is None or getattr(user, "admin", False) - username = getattr(user, "username", None) + username: str = getattr(user, "username", "") or "" def field(key, label, ftype, description="", editable=False, sensitive=False): raw = config.get(key) @@ -338,7 +338,7 @@ def get_settings_sections(config: dict, threshold_checker=None, user=None) -> li "logo": pattrs.get("logo", ""), }) - sections = [ + sections: list = [ { "id": "network", "title": "Network", @@ -523,7 +523,7 @@ def get_settings_data(config: dict, threshold_checker=None, user=None) -> dict: """Return sections list + auxiliary data for the settings template.""" sections = get_settings_sections(config, threshold_checker=threshold_checker, user=user) is_admin = user is None or getattr(user, "admin", False) - username = getattr(user, "username", None) + username: str = getattr(user, "username", "") or "" channels = config.get("notification_channels") or {} threshold_cfgs = config.get("threshold_configs") or {} if not is_admin: