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

@@ -95,7 +95,8 @@ async def process_text(message: Message, state: FSMContext):
await state.update_data(
words=words,
user_id=user.id,
original_text=text
original_text=text,
level=user.level.name
)
await state.set_state(ImportStates.viewing_words)
@@ -189,7 +190,7 @@ async def import_single_word(callback: CallbackQuery, state: FSMContext):
examples=[{"en": word_data.get('context', ''), "ru": ""}] if word_data.get('context') else [],
source=WordSource.CONTEXT,
category='imported',
difficulty_level=None
difficulty_level=data.get('level')
)
await callback.answer(f"✅ Слово '{word_data['word']}' добавлено в словарь")
@@ -226,7 +227,7 @@ async def import_all_words(callback: CallbackQuery, state: FSMContext):
examples=[{"en": word_data.get('context', ''), "ru": ""}] if word_data.get('context') else [],
source=WordSource.CONTEXT,
category='imported',
difficulty_level=None
difficulty_level=data.get('level')
)
added_count += 1