home · contact · privacy
Fix broken ProcessStep suppression.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 23 Dec 2024 21:08:30 +0000 (22:08 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 23 Dec 2024 21:08:30 +0000 (22:08 +0100)
plomtask/http.py
plomtask/processes.py
templates/process.html

index 99d385052fa6cd31e19a3a0a27b073d30c3d3644..e86d314510bfbdeae570577e45a0afdcb3df871f 100644 (file)
@@ -748,7 +748,7 @@ class TaskHandler(BaseHTTPRequestHandler):
                      in ['conditions', 'blockers', 'enables', 'disables']]
         calendarize = self._form.get_bool('calendarize')
         step_of = self._form.get_all_str('step_of')
-        suppressions = self._form.get_all_int('suppresses')
+        suppressions = self._form.get_all_int('suppressed_steps')
         kept_steps = self._form.get_all_int('kept_steps')
         new_top_step_procs = self._form.get_all_str('new_top_step')
         new_steps_to = {}
index 23eb624353b656c08f38b3c1c1150c0f48f9a4d5..d2e84109770e0f00d24b4e6f547e6ca38261b76f 100644 (file)
@@ -69,7 +69,11 @@ class Process(BaseModel[int], ConditionsRelations):
                 target = getattr(process, name)
                 target += [Condition.by_id(db_conn, c_id)]
         for row_ in db_conn.row_where('process_steps', 'owner', process.id_):
-            step = ProcessStep.from_table_row(db_conn, row_)
+            # NB: It's tempting to ProcessStep.from_table_row(row_) directly,
+            # but we don't want to unnecessarily invalidate cached ProcessSteps
+            # elsewhere (notably, other Processes .suppressed_steps), as a
+            # complete reload like this would do
+            step = ProcessStep.by_id(db_conn, row_[0])
             process.explicit_steps += [step]
         for row_ in db_conn.row_where('process_step_suppressions', 'process',
                                       process.id_):
index a4029dc333193ae95c20e93624d0a478b91dd4c1..cf0bb6e0d5bb036f86c3175f68a5d1ecf73a7388 100644 (file)
@@ -53,7 +53,7 @@ details[open] > summary::after {
 </td>
 {% if (not step_node.is_explicit) and (not step_node.seen) %}
 <td>
-<input type="checkbox" name="suppresses" value="{{step_id}}" {% if step_node.is_suppressed %}checked{% endif %}> suppress
+<input type="checkbox" name="suppressed_steps" value="{{step_id}}" {% if step_node.is_suppressed %}checked{% endif %}> suppress
 </td>
 {% endif %}
 </tr>