style(widgets): apply formatter to widget rebind files

This commit is contained in:
Developer
2026-06-22 18:22:18 +00:00
parent 10fd4ead4a
commit f6a86310cc
3 changed files with 6 additions and 12 deletions
@@ -58,10 +58,7 @@ def _validate_widget_input(body: WidgetInstanceInput, store: SettingsStore) -> N
if widget_kind is None:
raise HTTPException(
status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
detail=(
f"Service type '{service['service_type']}' does not provide "
f"widget kind '{body.widget_kind}'"
),
detail=(f"Service type '{service['service_type']}' does not provide widget kind '{body.widget_kind}'"),
)
if widget_kind.config_model is not None:
try:
@@ -76,8 +73,7 @@ def _validate_widget_input(body: WidgetInstanceInput, store: SettingsStore) -> N
raise HTTPException(
status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
detail=(
f"Unknown built-in widget kind '{body.widget_kind}' "
"(set service_id for service-bound widgets)"
f"Unknown built-in widget kind '{body.widget_kind}' (set service_id for service-bound widgets)"
),
)
try:
@@ -1404,10 +1404,7 @@ class SettingsStore:
) -> dict[str, Any]:
current = self.get_widget(widget_id) if widget_id else None
widget_id = str(payload.get("id") or widget_id or uuid.uuid4().hex[:12]).strip() or uuid.uuid4().hex[:12]
service_id = (
str(payload.get("service_id") or (current or {}).get("service_id") or "").strip()
or None
)
service_id = str(payload.get("service_id") or (current or {}).get("service_id") or "").strip() or None
widget_kind = str(payload.get("widget_kind") or (current or {}).get("widget_kind", "")).strip()
title = str(payload.get("title") or (current or {}).get("title", "") or "").strip()
config = payload.get("config", (current or {}).get("config", {}))