From 6ea663b4c477d5c162ff1d7c02432d456a57d5a0 Mon Sep 17 00:00:00 2001 From: Lars Date: Sun, 5 Jul 2026 15:38:57 +0200 Subject: [PATCH] =?UTF-8?q?fix(tests):=20AP0.10=20pytest=20=E2=80=94=20blo?= =?UTF-8?q?ckers=20ohne=20milestone=5Fid,=20COUNT=20mit=20RealDictCursor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Behebt test_steering_snapshot_graph und test_blocker_resolve_unblocks_action. Co-authored-by: Cursor --- backend/data_layer/initiative_snapshot.py | 3 +-- backend/services/operating_transitions.py | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/data_layer/initiative_snapshot.py b/backend/data_layer/initiative_snapshot.py index e7bbcd9..692cc68 100644 --- a/backend/data_layer/initiative_snapshot.py +++ b/backend/data_layer/initiative_snapshot.py @@ -108,7 +108,7 @@ def get_initiative_steering_snapshot( cur.execute( """ - SELECT id, action_id, milestone_id, title, status, created_at, updated_at + SELECT id, action_id, title, status, created_at, updated_at FROM blockers WHERE tenant_id = %s AND initiative_id = %s ORDER BY updated_at DESC @@ -194,7 +194,6 @@ def get_initiative_steering_snapshot( "title": b["title"], "status": b["status"], "action_id": _sid(b.get("action_id")), - "milestone_id": _sid(b.get("milestone_id")), } aid = item["action_id"] if aid: diff --git a/backend/services/operating_transitions.py b/backend/services/operating_transitions.py index 4c37f8f..b7e429a 100644 --- a/backend/services/operating_transitions.py +++ b/backend/services/operating_transitions.py @@ -46,13 +46,15 @@ def after_blocker_status_change( cur.execute( """ - SELECT COUNT(*) FROM blockers + SELECT COUNT(*) AS remaining + FROM blockers WHERE tenant_id = %s AND action_id = %s AND id != %s AND status IN ('open', 'in_progress') """, (tenant_id, action_id, blocker_id), ) - remaining = cur.fetchone()[0] + row = cur.fetchone() + remaining = int(row["remaining"]) if row else 0 if remaining > 0: effects.append( {