[Eva] fix show_words: json.loads для current_level_words

This commit is contained in:
2026-10-14 11:05:43 +00:00
parent 99dd3765d0
commit 0d6b56e5c9
+6 -1
View File
@@ -298,7 +298,12 @@ async def show_words(request: Request):
if difficulty == "medium" and list_opened >= 1: if difficulty == "medium" and list_opened >= 1:
raise HTTPException(400, "Word list already used on Medium difficulty") raise HTTPException(400, "Word list already used on Medium difficulty")
level_words = progress["current_level_words"] or [] raw = progress["current_level_words"]
if isinstance(raw, str):
level_words = json.loads(raw) if raw else []
else:
level_words = raw or []
words = [ words = [
{"word_pl": w.get("word_pl"), "translation": w.get("translation")} {"word_pl": w.get("word_pl"), "translation": w.get("translation")}
for w in level_words for w in level_words