home · contact · privacy
Simplify and improve previous bugfix.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 9 Jun 2024 05:30:46 +0000 (07:30 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 9 Jun 2024 05:30:46 +0000 (07:30 +0200)
plomtask/http.py
templates/todo.html

index 44c710b3b9bd46e04f67a210d6c3e526b0d43724..71305b218aee0ef61b1e0589e18fad7b2671c6f1 100644 (file)
@@ -389,8 +389,7 @@ class TaskHandler(BaseHTTPRequestHandler):
         todo.set_blockers(self.conn, self.form_data.get_all_int('blocker'))
         todo.set_enables(self.conn, self.form_data.get_all_int('enables'))
         todo.set_disables(self.conn, self.form_data.get_all_int('disables'))
-        if len(self.form_data.get_all_str('done')) > 0 != todo.is_done:
-            todo.is_done = len(self.form_data.get_all_str('done')) > 0
+        todo.is_done = len(self.form_data.get_all_str('done')) > 0
         todo.calendarize = len(self.form_data.get_all_str('calendarize')) > 0
         todo.comment = self.form_data.get_str('comment', ignore_strict=True)
         todo.save(self.conn)
index 05e5b62c8aebfd0224ca3655b40e5dae906e3984..fd16680badfb894775a7e568f4fc31f1a21dfd82 100644 (file)
 </tr>
 <tr>
 <th>done</th>
-<td><input type="checkbox" name="done" {% if todo.is_done %}checked {% endif %} {% if not todo.is_doable %}disabled {% endif %}/><br /></td>
+<td><input type="checkbox" name="done" {% if todo.is_done %}checked {% endif %} {% if not todo.is_doable %}disabled {% endif %}/>
+{% if not todo.is_doable and todo.is_done %}<input type="hidden" name="done" value="1" />{% endif %}
+</td>
 </tr>
 <tr>
 <th>effort</th>
-<td><input type="number" name="effort" step=0.1 size=5 placeholder={{todo.effort_then}} value={{todo.effort}} /><br /></td>
+<td><input type="number" name="effort" step=0.1 size=5 placeholder={{todo.effort_then}} value={{todo.effort}} /></td>
 </tr>
 <tr>
 <th>comment</th>