feat: replace a race's line or a place's position from an updated file - #193
Merged
Merged
Conversation
Import only ever added, so a revised route became a second course with none of the first one's settings and a moved stop a second place. The review screen's assign box now has Replace: a staged line replaces an existing course's geometry (re-turned to its stated start; refused with nothing changed if its ends miss it) and one staged point moves an existing place, listed nearest first. Everything the club set stays; the screen says how far a place moved, since its What3Words names the old spot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QkbtsMnQEe8HZ7xyxXHYHB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Import only ever added. An organizer's revised Half became a second "Half" with none of the first one's settings; a moved water stop a second "A" with no ticks, order, What3Words or operator - and the originals could not be deleted once anything referred to them. Two weeks before the Mankato Marathon, a revised file is expected.
What it does
The Import review's assign box gets Replace:
importer.replace_course_lineswaps the geometry on the existing row: id, name, colours, start time, Starts at / Finishes at, the races ticked on its stops and its lead runner reports stay. The new line is re-turned to the stated start (admin._set_course_ends); a line whose ends miss it is refused and the transaction rolls back.importer.replace_poi_positionmoves it; name, layer, order, races, label, notes, What3Words and posted operator stay. Places are listed nearest first with the distance. The response carriesmoved_mand the screen says the What3Words still names the old spot.discarded, so deleting the course later does not put both versions back in review.Checked
tests/test_replace.py(10); full suite 892 passed.Half.kmz(same course id, 07:30 start kept, one Half, 14.6 -> 13.1 mi); moved a stop 72 m via a point the dropdown listed first.setup.md("An updated file from the organizer"), runbook step 3, CLAUDE.md import rule.🤖 Generated with Claude Code
https://claude.ai/code/session_01QkbtsMnQEe8HZ7xyxXHYHB