[Eva] fix first_part_hint: json.loads для current_level_words и hinted_words

This commit is contained in:
2026-10-14 11:05:46 +00:00
parent 0d6b56e5c9
commit e7c512e50e
+11 -2
View File
@@ -229,8 +229,17 @@ async def first_part_hint(request: Request):
if hints_used >= 3:
raise HTTPException(400, "All hints used")
level_words = progress["current_level_words"] or []
hinted = set(progress["hinted_words"] or [])
raw = progress["current_level_words"]
if isinstance(raw, str):
level_words = json.loads(raw) if raw else []
else:
level_words = raw or []
raw_hinted = progress["hinted_words"]
if isinstance(raw_hinted, str):
hinted = set(json.loads(raw_hinted)) if raw_hinted else set()
else:
hinted = set(raw_hinted or [])
# Слова, которые ещё не собраны и которым ещё не давали подсказку
candidates = [