fix: Replace fragile locals() pattern in PATCH endpoints #11

Merged
cal merged 2 commits from fix/patch-endpoint-locals-bug into main 2026-02-12 15:37:11 +00:00
Owner

Summary- Teams PATCH endpoint returned 500 error because locals() captured the data variable itself, causing Peewee to try setting a non-existent Team.data column- Players PATCH had the same fragile pattern with an order-dependent workaround- Both endpoints now use explicit field dicts instead of locals()## 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

## Summary- Teams PATCH endpoint returned 500 error because `locals()` captured the `data` variable itself, causing Peewee to try setting a non-existent `Team.data` column- Players PATCH had the same fragile pattern with an order-dependent workaround- Both endpoints now use explicit field dicts instead of `locals()`## 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
cal added 1 commit 2026-02-11 21:54:59 +00:00
fix: Replace fragile locals() pattern in PATCH endpoints with explicit field dicts
Some checks failed
Build Docker Image / build (pull_request) Failing after 15s
31b14ec709
The teams PATCH endpoint included the `data` variable itself when
building the update dict via locals(), causing Peewee to fail with
"type object 'Team' has no attribute 'data'". The players endpoint
had the same pattern with a workaround that was order-dependent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cal added 1 commit 2026-02-11 21:55:38 +00:00
Update VERSION
All checks were successful
Build Docker Image / build (pull_request) Successful in 3m16s
e257a96a8a
cal merged commit 7434f69a59 into main 2026-02-12 15:37:11 +00:00
cal deleted branch fix/patch-endpoint-locals-bug 2026-02-12 15:37:12 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/major-domo-database#11
No description provided.