Enforce 500 m minimum segment length in UI and API

This commit is contained in:
Davide Scaini
2026-05-13 00:56:04 +02:00
parent e9e7b5d0e7
commit 6c9de35426
2 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -2445,8 +2445,8 @@ async def create_segment(
user = _require_user(bincio_session)
if len(body.polyline) < 2:
raise HTTPException(400, "polyline must have at least 2 points")
if body.distance_m <= 0:
raise HTTPException(400, "distance_m must be positive")
if body.distance_m < 500:
raise HTTPException(400, "segment must be at least 500 m long")
lats = [p[0] for p in body.polyline]
lons = [p[1] for p in body.polyline]