fix: Resolve Player.data AttributeError in patch_player endpoint #3
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#3
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/player-data-attribute-error"
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?
Fixes critical bug where IL moves and team reassignments failed with:
"type object 'Player' has no attribute 'data'"
Root Cause:
Changes:
Impact:
Version: 2.5.1 → 2.5.2
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com
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>