major-domo-database/app/services
Cal Corum f13815a162
All checks were successful
Build Docker Image / build (pull_request) Successful in 2m18s
fix: Resolve Player.data AttributeError in patch_player endpoint
Fixes critical bug where IL moves and team reassignments failed with:
  "type object 'Player' has no attribute 'data'"

Root Cause:
- model_to_dict() with recurse=True attempted to serialize foreign keys
- Peewee internal serialization incorrectly accessed Player.data class attribute

Changes:
- Add backrefs=False to model_to_dict() to prevent circular reference issues
- Add comprehensive exception handling with graceful fallback
- Fallback chain: recursive → non-recursive → basic dict conversion
- Add warning/error logging to track serialization failures

Impact:
- Fixes /ilmove command failures (player team updates)
- Prevents PATCH /api/v3/players/{id} endpoint errors
- Maintains backward compatibility with all response formats

Version: 2.5.1 → 2.5.2

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 14:41:16 -06:00
..
__init__.py refactor: Extract services layer for testability 2026-02-03 15:38:34 +00:00
base.py Fix linting and formatting issues 2026-02-04 08:44:12 -06:00
interfaces.py fix: Complete dependency injection for PlayerService 2026-02-03 16:49:50 +00:00
mocks.py fix: Complete dependency injection refactor and restore caching 2026-02-04 01:13:46 -06:00
player_service.py fix: Resolve Player.data AttributeError in patch_player endpoint 2026-02-04 14:41:16 -06:00
team_service.py Fix linting and formatting issues 2026-02-04 08:44:12 -06:00