From 679f99d701cdb5c598d7487f445b0e911842c43b Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 23 Feb 2021 00:11:51 +0100 Subject: [PATCH] change checkbox handling to detect presence --- owrx/form/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/owrx/form/__init__.py b/owrx/form/__init__.py index 2001fd2..ecf17fd 100644 --- a/owrx/form/__init__.py +++ b/owrx/form/__init__.py @@ -184,7 +184,8 @@ class CheckboxInput(Input): def render_input(self, value): return """
- + + @@ -201,7 +202,9 @@ class CheckboxInput(Input): return " ".join(["form-check", "form-control-sm"]) def parse(self, data): - return {self.id: self.converter.convert_from_form(self.id in data and data[self.id][0] == "on")} + if self.id in data: + return {self.id: self.converter.convert_from_form("1" in data[self.id])} + return {} def getLabel(self): return self.checkboxText