fix: synchronize normalized records on import revisions

This commit is contained in:
ik
2026-09-11 07:50:31 +07:00
parent 2ad2bdcdff
commit 1ffaf7478d
+8
View File
@@ -206,6 +206,14 @@ def _import_records_locked(session: Session, *, url: str, region: str, category:
if old_val != new_val:
changed_fields[field] = {"old": old_val, "new": new_val}
if changed_fields:
# Keep the queryable normalized record in sync with its
# versioned source payload.
report.fish = fish
report.waterbody = waterbody
report.bait = bait
report.weight_g = raw.weight_g
report.player_name = raw.player
report.caught_at = caught
report.raw_payload = payload
report.source_url = url
session.add(ImportRecordEvent(