fix: synchronize normalized records on import revisions
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user