fix: Replace fragile locals() pattern in PATCH endpoints #11
No reviewers
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-database#11
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/patch-endpoint-locals-bug"
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- Teams PATCH endpoint returned 500 error because
locals()captured thedatavariable itself, causing Peewee to try setting a non-existentTeam.datacolumn- Players PATCH had the same fragile pattern with an order-dependent workaround- Both endpoints now use explicit field dicts instead oflocals()## Changes-app/routers_v3/teams.py- Replace locals() with explicit dict comprehension-app/routers_v3/players.py- Same fix for consistency and safety## Testing- PATCH /teams/555 with thumbnail param should now return 200- PATCH /players/{id} with any single param should continue working