feat: unauthenticated photo upload for registration #109
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api!109
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "108-register-photo-upload"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
POST /api/register/upload-photopublic endpoint for uploading player photos during the registration flow without authenticationPOST /api/registeralready savesphoto_urlto the player record (no changes needed)Changes
src/basketball_api/routes/register.py: Addedregister_upload_photo()async endpoint with full validation. MovedJSONResponseimport to module-level (was a lazy import insideapi_register). Addedos,uuid,UploadFileimports.tests/test_register_upload.py: 15 new tests across two classes --TestRegisterUploadPhoto(13 tests covering valid uploads, invalid extensions, content type, size limits, empty file, no-auth) andTestApiRegisterWithPhoto(2 tests verifying photo_url persistence through registration).Test Plan
ruff formatandruff checkcleanPOST /upload/photo(auth-required) untouchedReview Checklist
Related
Review - Pass
Files reviewed:
src/basketball_api/routes/register.py,tests/test_register_upload.pyFindings: No issues found.
{"error": "..."}JSON format with 400 statusupload.pyat function scope (avoids circular imports)POST /upload/photois untouchedJSONResponseimport cleanup (module-level instead of lazy) is correct