Skip to content

feat: replace a race's line or a place's position from an updated file - #193

Merged
MikeWills merged 1 commit into
mainfrom
feature/replace-line-and-stop
Sep 30, 2026
Merged

MikeWills merged 1 commit into
mainfrom
feature/replace-line-and-stop

Conversation

@MikeWills

Copy link
Copy Markdown
Owner

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:

  • Lines -> a race. importer.replace_course_line swaps 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.
  • One point -> a place. importer.replace_poi_position moves it; name, layer, order, races, label, notes, What3Words and posted operator stay. Places are listed nearest first with the distance. The response carries moved_m and the screen says the What3Words still names the old spot.
  • The replaced features go to discarded, so deleting the course later does not put both versions back in review.
  • Matching is always a person's pick - never automatic.

Checked

  • tests/test_replace.py (10); full suite 892 passed.
  • In the browser against the demo: replaced the demo Half with the real organizer 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.
  • Guide 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

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
@MikeWills
MikeWills merged commit 931aa95 into main Sep 30, 2026
2 checks passed
@MikeWills
MikeWills deleted the feature/replace-line-and-stop branch September 30, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant