home · contact · privacy
Fix broken POST /condition parsing of "is active" setting.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 7 Aug 2024 12:57:06 +0000 (14:57 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 7 Aug 2024 12:57:06 +0000 (14:57 +0200)
plomtask/http.py

index 1aa2e492c9e611877ab1dbe4f160b483c48b2fa1..2c8eecbe07bf2cb53284a41d885d47494656b2aa 100644 (file)
@@ -786,12 +786,11 @@ class TaskHandler(BaseHTTPRequestHandler):
     def do_POST_condition(self, condition: Condition) -> str:
         """Update/insert Condition of ?id= and fields defined in postvars."""
         try:
-            is_active = self._form_data.get_str('is_active') == 'True'
             title = self._form_data.get_str('title')
             description = self._form_data.get_str('description')
         except NotFoundException as e:
             raise BadFormatException(e) from e
-        condition.is_active = is_active
+        condition.is_active = self._form_data.get_bool('is_active')
         condition.title.set(title)
         condition.description.set(description)
         condition.save(self.conn)