fix: Resolve Player.data AttributeError in patch_player endpoint #3

Merged
cal merged 1 commits from fix/player-data-attribute-error into main 2026-02-04 20:49:28 +00:00
Owner

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

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>
cal added 1 commit 2026-02-04 20:41:55 +00:00
fix: Resolve Player.data AttributeError in patch_player endpoint
All checks were successful
Build Docker Image / build (pull_request) Successful in 2m18s
f13815a162
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>
cal merged commit 3421f489ee into main 2026-02-04 20:49:28 +00:00
cal deleted branch fix/player-data-attribute-error 2026-02-04 20:49:28 +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#3
No description provided.