store: PR review: paper-dynasty-database#37 — remove dead roster CSV fields

This commit is contained in:
Cal Corum 2026-03-03 14:03:36 -06:00
parent 8d310a37d9
commit 7065ad55ec

View File

@ -0,0 +1,30 @@
---
id: 96137768-1e1e-4d7c-9890-6443ecd5cc36
type: workflow
title: "PR review: paper-dynasty-database#37 — remove dead roster CSV fields"
tags: [pr-reviewer, paper-dynasty-database, fastapi, peewee, python, cards-router]
importance: 0.4
confidence: 0.8
created: "2026-03-03T20:03:36.362466+00:00"
updated: "2026-03-03T20:03:36.362466+00:00"
---
## PR #37: fix: remove dead roster fields from CSV in v1_cards_get_one
**Verdict**: APPROVED (posted as COMMENT — Gitea blocks self-approval)
**Branch**: ai/paper-dynasty-database-36 (AI-generated)
**File reviewed**: app/routers_v2/cards.py
### Summary
Removed `roster1`, `roster2`, `roster3` from the CSV output in `v1_cards_get_one`. These fields don't exist on the `Card` model (confirmed in db_engine.py lines 472491 — only `player`, `team`, `pack`, `value`). Accessing them would raise `AttributeError` on every `GET /api/v2/cards/{card_id}?csv=true` request.
### Key Findings
- Fix is correct and verified against Card model definition
- Ruff reformatted entire file (single → double quotes) alongside the fix — noisy diff but harmless
- Pre-existing inconsistency: get_cards CSV uses `player.p_name`, v1_cards_get_one CSV uses raw `this_card.player` (__str__)
- v1_cards_patch still has dead roster1_id/roster2_id/roster3_id params that are accepted but silently dropped by Peewee save() — follow-up issue recommended
### Patterns Noted
- Card model fields: player (FK), team (FK), pack (FK), value (int) — no roster fields
- Peewee silently ignores assignment to undeclared model attributes on save()
- Gitea blocks APPROVED review state for self-owned PRs; use COMMENT instead