X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=plomtask%2Fhttp.py;h=2b41db82e00e5d4cfac862161fb352607d09dfbb;hb=a99b13325a21042825450d2497ddf61f8c5c3644;hp=800193ce49ab7c90a1ff00add0a9d3fd32cf8b4e;hpb=e14580b4ee47363cad317e4ec1de91affe03d53a;p=plomtask diff --git a/plomtask/http.py b/plomtask/http.py index 800193c..2b41db8 100644 --- a/plomtask/http.py +++ b/plomtask/http.py @@ -212,6 +212,10 @@ class TaskHandler(BaseHTTPRequestHandler): def do_POST_todo(self) -> str: """Update Todo and its children.""" id_ = self.params.get_int('id') + for _ in self.form_data.get_all_str('delete'): + todo = Todo .by_id(self.conn, id_) + todo.remove(self.conn) + return '/' todo = Todo.by_id(self.conn, id_) adopted_child_ids = self.form_data.get_all_int('adopt') for child in todo.children: @@ -273,6 +277,10 @@ class TaskHandler(BaseHTTPRequestHandler): def do_POST_condition(self) -> str: """Update/insert Condition of ?id= and fields defined in postvars.""" id_ = self.params.get_int_or_none('id') + for _ in self.form_data.get_all_str('delete'): + condition = Condition.by_id(self.conn, id_) + condition.remove(self.conn) + return '/conditions' condition = Condition.by_id(self.conn, id_, create=True) condition.title.set(self.form_data.get_str('title')) condition.description.set(self.form_data.get_str('description'))