X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=plomtask%2Fhttp.py;h=5a7126e3232176630d78ddd43b10bb659c425e94;hb=aed1d5968abf97976db3725347fe4e7672c935e7;hp=5d165ecf90f1ca6ebaed77e55b73a5d55ff428b8;hpb=12195a1fe2c15334c866036eaa171eb8e92f0408;p=plomtask diff --git a/plomtask/http.py b/plomtask/http.py index 5d165ec..5a7126e 100644 --- a/plomtask/http.py +++ b/plomtask/http.py @@ -209,7 +209,12 @@ class TaskHandler(BaseHTTPRequestHandler): if child_id is not None: child = Todo.by_id(conn, child_id) todo.add_child(child) - todo.is_done = len(form_data.get_all_str('done')) > 0 + if len(form_data.get_all_str('done')) > 0: + if not todo.is_doable: + raise BadFormatException('cannot set undoable Todo to done') + todo.is_done = True + else: + todo.is_done = False todo.save(conn) def do_POST_process(self, conn: DatabaseConnection, params: ParamsParser,