X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=plomtask%2Fhttp.py;h=dbc78ebaeb0b17aa3ff5173c40c6c96036255261;hb=3346c7fab2fda82b290d245798f4537b43abb012;hp=f5e24edecfc0c3bfb86700cc3a5d709db3f24c68;hpb=3b97ae2a26cbc80983d56ee5d0b4ac5334038467;p=plomtask
diff --git a/plomtask/http.py b/plomtask/http.py
index f5e24ed..dbc78eb 100644
--- a/plomtask/http.py
+++ b/plomtask/http.py
@@ -256,21 +256,8 @@ class TaskHandler(BaseHTTPRequestHandler):
day = Day.by_id(self.conn, date, create=True)
day.comment = self.form_data.get_str('day_comment')
day.save(self.conn)
- new_todos = []
- for process_id in self.form_data.get_all_int('new_todo'):
- process = Process.by_id(self.conn, process_id)
- todo = Todo(None, process, False, day.date)
- todo.save(self.conn)
- new_todos += [todo]
- adopted = True
- while adopted:
- adopted = False
- existing_todos = Todo.by_date(self.conn, date)
- for todo in new_todos:
- if todo.adopt_from(existing_todos):
- adopted = True
- todo.make_missing_children(self.conn)
- todo.save(self.conn)
+ Todo.create_with_children(self.conn, date,
+ self.form_data.get_all_int('new_todo'))
done_ids = self.form_data.get_all_int('done')
comments = self.form_data.get_all_str('comment')
efforts = self.form_data.get_all_str('effort')