From: Christian Heller Date: Mon, 23 Dec 2024 21:08:30 +0000 (+0100) Subject: Fix broken ProcessStep suppression. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/process_titles?a=commitdiff_plain;h=b7cd01785f7fbf1f489e297f2aea2e8477e0d05a;p=plomtask Fix broken ProcessStep suppression. --- diff --git a/plomtask/http.py b/plomtask/http.py index 99d3850..e86d314 100644 --- a/plomtask/http.py +++ b/plomtask/http.py @@ -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 = {} diff --git a/plomtask/processes.py b/plomtask/processes.py index 23eb624..d2e8410 100644 --- a/plomtask/processes.py +++ b/plomtask/processes.py @@ -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_): diff --git a/templates/process.html b/templates/process.html index a4029dc..cf0bb6e 100644 --- a/templates/process.html +++ b/templates/process.html @@ -53,7 +53,7 @@ details[open] > summary::after { {% if (not step_node.is_explicit) and (not step_node.seen) %} - suppress + suppress {% endif %}