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(