Fix coach deck dropdown: wrong column name d.commander → d.commander_name

The decks table has 'commander_name' not 'commander'. The SQL query
was throwing OperationalError which the frontend silently caught,
resulting in an empty dropdown.
This commit is contained in:
KoalaTrapLord committed 2026-03-12 14:55:46 +00:00
1 parent 44bc86b665
commit 26e554b359
2 files changed
+26 -26

No files matched your search

+2 -2
View File
@@ -7058,7 +7058,7 @@ async def coach_list_decks():
"""List all decks available for coaching (from deck builder DB)."""
conn = _get_db_conn()
rows = conn.execute(
"""SELECT d.id as deck_id, d.name as deck_name, d.commander,
"""SELECT d.id as deck_id, d.name as deck_name, d.commander_name,
COUNT(dc.id) as card_count
FROM decks d
LEFT JOIN deck_cards dc ON dc.deck_id = d.id
@@ -7083,7 +7083,7 @@ async def coach_list_decks():
decks.append({
"deck_id": r["deck_id"],
"deck_name": r["deck_name"],
"commander": r["commander"] or "",
"commander": r["commander_name"] or "",
"card_count": r["card_count"],
"has_report": has_report,
"report_count": 1 if has_report else 0,