fix: normalize deck report slug matching (spaces/hyphens/underscores)

This commit is contained in:
KoalaTrapLord authored and GitHub committed 2026-03-24 13:31:52 -04:00
1 parent a6940ca61a
commit 41b711c17e
1 file changed
+2 -1
+2 -1
View File
@@ -10,6 +10,7 @@ import json
import logging
import uuid
import os
import re
from datetime import datetime, timezone
from pathlib import Path
from typing import Optional, List, Dict
@@ -57,7 +58,7 @@ class CoachService:
if not report_path.exists():
# Try case-insensitive match
for f in DECK_REPORTS_DIR.glob("*.json"):
if f.stem.lower() == deck_id.lower():
if re.sub(r'[^a-z0-9]', '', f.stem.lower()) == re.sub(r'[^a-z0-9]', '', deck_id.lower()):
report_path = f
break