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,