[Eva] fix first_part_hint: json.loads для current_level_words и hinted_words
This commit is contained in:
+11
-2
@@ -229,8 +229,17 @@ async def first_part_hint(request: Request):
|
|||||||
if hints_used >= 3:
|
if hints_used >= 3:
|
||||||
raise HTTPException(400, "All hints used")
|
raise HTTPException(400, "All hints used")
|
||||||
|
|
||||||
level_words = progress["current_level_words"] or []
|
raw = progress["current_level_words"]
|
||||||
hinted = set(progress["hinted_words"] or [])
|
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 = [
|
candidates = [
|
||||||
|
|||||||
Reference in New Issue
Block a user