fix: type annotations for mypy parity with master
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NfPpSpccTWBfZg1FTveyaU
This commit is contained in:
+1
-1
@@ -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}
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user