Major Domo Database - PostgreSQL database service for SBA bot
Go to file
Cal Corum 6d36704f35
Some checks failed
Build Docker Image / build (pull_request) Has been cancelled
fix: Prevent locals() from polluting player PATCH data dict
CRITICAL BUG FIX - Root cause of Player.data AttributeError

Problem:
The PATCH endpoint was calling locals() AFTER creating data = {}, causing
locals_dict to capture 'data' and 'locals_dict' as variables. The loop then
added these to the data dict itself, resulting in:
  data = {'team_id': 549, 'demotion_week': 7, 'data': {}, 'locals_dict': {...}}

When Peewee executed Player.update(**data), it tried to set Player.data = {},
but Player model has no 'data' field, causing AttributeError.

Solution:
1. Call locals() BEFORE creating data dict
2. Exclude 'locals_dict' from the filter (along with 'player_id', 'token')

This ensures only actual player field parameters are included in the update.

Version: 2.5.2 → 2.5.3

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 14:57:32 -06:00
.claude File cleanup 2025-10-25 20:17:02 -05:00
.gitea/workflows Add Gitea Actions CI/CD pipeline 2026-02-04 11:43:18 -06:00
app fix: Prevent locals() from polluting player PATCH data dict 2026-02-04 14:57:32 -06:00
migrations Add salary_cap column to Team model (v2.2.0) 2025-12-10 07:28:16 -06:00
scripts CLAUDE: Add --clean flag to production database sync 2025-10-23 16:52:42 -05:00
test-storage CLAUDE: Phase 1 PostgreSQL migration fixes complete 2025-08-18 18:09:45 -05:00
tests fix: Complete dependency injection refactor and restore caching 2026-02-04 01:13:46 -06:00
.dockerignore Adding Git and Docker files 2023-02-21 11:53:02 -06:00
.env Local migration fully functional 2025-08-20 09:52:46 -05:00
.gitignore Local migration fully functional 2025-08-20 09:52:46 -05:00
=2.9.0 CLAUDE: Phase 1 PostgreSQL migration fixes complete 2025-08-18 18:09:45 -05:00
CLAUDE.md Fix custom command creator POST validation (v2.3.1) 2025-12-13 16:31:47 -06:00
data_consistency_check.py fix: Implement proper dependency injection for PlayerService 2026-02-03 16:45:46 +00:00
DATA_CONSISTENCY_REPORT.md fix: Critical router-service integration issues 2026-02-03 17:20:40 +00:00
db_engine.py DB Error Handling 2025-08-20 19:33:40 -05:00
deploy.sh Add Gitea Actions CI/CD pipeline 2026-02-04 11:43:18 -06:00
docker-compose.yml Add Redis Caching 2025-08-27 22:49:37 -05:00
Dockerfile Local migration fully functional 2025-08-20 09:52:46 -05:00
Dockerfile.optimized Postgres Query Updates 2025-08-25 07:19:13 -05:00
GITEA_ACTIONS_SETUP.md Add Gitea Actions CI/CD pipeline 2026-02-04 11:43:18 -06:00
LICENSE Initial commit 2023-02-19 21:42:32 -06:00
main.py Merge pull request #2 from calcorum/api-rebuild 2023-07-24 23:06:53 -05:00
migrations.py Season 9 Additions 2024-01-14 22:44:23 -06:00
pd_master.db Logging updates 2024-12-16 09:03:23 -06:00
pytest.ini refactor: Add dependency injection for testability 2026-02-03 15:59:04 +00:00
REFACTOR_DOCUMENTATION.md docs: Add comprehensive refactor documentation 2026-02-03 20:12:29 +00:00
requirements.txt refactor: Add dependency injection for testability 2026-02-03 15:59:04 +00:00
VERSION fix: Prevent locals() from polluting player PATCH data dict 2026-02-04 14:57:32 -06:00