fix imports
Some checks failed
continuous-integration/drone/push Build is failing

update search_by_item and show_order
This commit is contained in:
2025-09-26 20:26:48 +03:00
parent 355f81520c
commit 8604774741
2 changed files with 1 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ from aiogram.fsm.state import State, StatesGroup
class SearchForm(StatesGroup):
search_option = State()
data_to_search = State()
sent_messages = State()
search_result = State()

View File

@@ -132,14 +132,6 @@ async def search_by_item(message: Message, state: FSMContext):
async def show_order(callback: CallbackQuery, state: FSMContext, bot: Bot):
order_id = int(re.search(r"(\d+)", callback.data).group())
try:
async with async_session_() as local_session:
result = await local_session.execute(select(Order).filter(Order.id == order_id))
order = result.scalars().first()
except Exception as err:
logger.warning(err)
order = next(filter(lambda item: order_id == item.id, await state.get_value("search_result")), None)
if order: