fix(tasks): handle next_task by resetting FSM to doing_tasks; add stop/cancel controls and stop button\n\nfix(words/import): pass user level into VocabularyService.add_word via difficulty_level; rename incorrect 'difficulty' arg to 'difficulty_level'

This commit is contained in:
2025-12-04 16:44:16 +03:00
parent 80f248770a
commit cf8f71e24a
3 changed files with 37 additions and 7 deletions

View File

@@ -69,7 +69,8 @@ async def cmd_words(message: Message, state: FSMContext):
await state.update_data(
theme=theme,
words=words,
user_id=user.id
user_id=user.id,
level=user.level.name
)
await state.set_state(WordsStates.viewing_words)
@@ -155,7 +156,7 @@ async def add_single_word(callback: CallbackQuery, state: FSMContext):
examples=[{"en": word_data.get('example', ''), "ru": ""}] if word_data.get('example') else [],
source=WordSource.SUGGESTED,
category=data.get('theme', 'general'),
difficulty=None
difficulty_level=data.get('level')
)
await callback.answer(f"✅ Слово '{word_data['word']}' добавлено в словарь")
@@ -193,7 +194,7 @@ async def add_all_words(callback: CallbackQuery, state: FSMContext):
examples=[{"en": word_data.get('example', ''), "ru": ""}] if word_data.get('example') else [],
source=WordSource.SUGGESTED,
category=theme,
difficulty=None
difficulty_level=data.get('level')
)
added_count += 1