From 8f3480ee2e297e636577ac6bb1b8bbca5bd71318 Mon Sep 17 00:00:00 2001 From: hermes Date: Sat, 29 Aug 2026 18:35:24 +0400 Subject: [PATCH] =?UTF-8?q?FIX-CFG-01:=20Unchecked=20checkbox=20=E2=86=92?= =?UTF-8?q?=20False=20(statt=20Wert=20beibehalten)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: Wenn ein User eine Bool-Checkbox unchecked ließ, sendete der Browser das Form-Field gar nicht. /api/plugin_config und /plugins/ machten 'continue' und überschrieben den alten True-Wert nie. Fix: Bei ftype=bool und form_val=None explizit new_cfg[key] = False setzen. Betrifft z.B. clock_wordclock.show_date/show_weekday/show_es_ist. --- admin.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/admin.py b/admin.py index c1d13ed..bba3470 100644 --- a/admin.py +++ b/admin.py @@ -197,7 +197,10 @@ def save_plugin_config(idx): new_cfg[key] = form_val continue if form_val is None: - continue + if ftype == "bool": + new_cfg[key] = False + else: + continue try: if ftype == "int": new_cfg[key] = int(form_val) @@ -476,7 +479,10 @@ def api_plugin_config(plugin_name): form_val = request.form.get(f"config_{key}") ftype = field.get("type", "string") if form_val is None: - continue + if ftype == "bool": + new_cfg[key] = False # unchecked checkbox → False + else: + continue if ftype == "secret": # Nur überschreiben wenn nicht leer existing = cfg.get("plugin_configs", {}).get(plugin_name, {}).get(key, "")