home · contact · privacy
When opening new Process from ProcessStep add field, pre-set as owned by previous...
authorChristian Heller <c.heller@plomlompom.de>
Thu, 6 Jun 2024 03:15:12 +0000 (05:15 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 6 Jun 2024 03:15:12 +0000 (05:15 +0200)
plomtask/http.py

index 9bb96f9c3a23aab0e470feba437038796302ffe8..9680778bcdb21cd8526a3db46530e55ee8aa0834 100644 (file)
@@ -240,9 +240,12 @@ class TaskHandler(BaseHTTPRequestHandler):
         if title_64:
             title = b64decode(title_64.encode()).decode()
             process.title.set(title)
+        owners = process.used_as_step_by(self.conn)
+        for step_id in self.params.get_all_int('step_to'):
+            owners += [Process.by_id(self.conn, step_id)]
         return {'process': process, 'is_new': process.id_ is None,
                 'steps': process.get_steps(self.conn),
-                'owners': process.used_as_step_by(self.conn),
+                'owners': owners,
                 'n_todos': len(Todo.by_process_id(self.conn, process.id_)),
                 'process_candidates': Process.all(self.conn),
                 'condition_candidates': Condition.all(self.conn)}
@@ -418,7 +421,8 @@ class TaskHandler(BaseHTTPRequestHandler):
         process.set_owners(self.conn, self.form_data.get_all_int('step_of'))
         if new_process_title:
             title_b64_encoded = b64encode(new_process_title.encode()).decode()
-            return f'/process?title_b64={title_b64_encoded}'
+            params = f'step_to={process.id_}&title_b64={title_b64_encoded}'
+            return f'/process?{params}'
         return f'/process?id={process.id_}'
 
     def do_POST_condition(self) -> str: