From 7d0e76150bd29618072631b08f4ac741c941a32f Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 20 Jun 2026 09:30:42 -0600 Subject: [PATCH] fix(store): drop dead defensive guard in get_claim_detail (FK guarantees batch exists) --- backend/src/cyclone/store.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/backend/src/cyclone/store.py b/backend/src/cyclone/store.py index 3e4a892..9f11286 100644 --- a/backend/src/cyclone/store.py +++ b/backend/src/cyclone/store.py @@ -1086,12 +1086,11 @@ class CycloneStore: .all() ) - parsed_at = ( - row.batch.parsed_at - if row.batch is not None - else None - ) - if parsed_at is not None and parsed_at.tzinfo is None: + # Claim.batch_id is FK NOT NULL with ON DELETE CASCADE, so + # ``row.batch`` is always populated in normal flow. Re-attach + # UTC only when SQLite drops the tzinfo on read. + parsed_at = row.batch.parsed_at + if parsed_at.tzinfo is None: parsed_at = parsed_at.replace(tzinfo=timezone.utc) detail = to_ui_claim_detail(