Auto-create athlete in startlist for unrecognized bib numbers
Build & Deploy / build-and-deploy (push) Successful in 45s
Build & Deploy / build-and-deploy (push) Successful in 45s
When a bib number is detected (via OCR or manual entry during review) but not found in the start list, it is now automatically added with the placeholder name "Ukjent #<nr>" instead of being left without a profile_id (which would exclude it from results). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+5
-1
@@ -22,6 +22,7 @@ from profile_db import (
|
||||
clear_startlist,
|
||||
delete_athlete,
|
||||
get_db,
|
||||
get_or_create_athlete,
|
||||
import_startlist_csv,
|
||||
list_athletes,
|
||||
)
|
||||
@@ -213,8 +214,11 @@ class ResolveRequest(BaseModel):
|
||||
|
||||
@app.post("/api/passages/{passage_id}/resolve")
|
||||
async def resolve(passage_id: str, body: ResolveRequest, db=Depends(get_connection)):
|
||||
profile_id = body.profile_id
|
||||
if body.bib_number and not profile_id:
|
||||
profile_id = await get_or_create_athlete(db, body.bib_number)
|
||||
ok = await resolve_passage(db, passage_id,
|
||||
profile_id=body.profile_id,
|
||||
profile_id=profile_id,
|
||||
bib_number=body.bib_number,
|
||||
review_note=body.review_note)
|
||||
if not ok:
|
||||
|
||||
Reference in New Issue
Block a user