@ -20,7 +20,6 @@ from . import markups
from . helper_functions import (
base_handler ,
delete_message ,
escape ,
get_state ,
register_state ,
send_deleteable_message ,
@ -36,7 +35,7 @@ async def get_accounts(
mes : Message ,
) - > None :
await base_handler ( bot , mes )
accounts = db . get . get_accounts (
accounts = db . get . get_account_name s (
engine ,
mes . from_user . id ,
to_sort = True ,
@ -210,7 +209,7 @@ async def _add_account2(
mes . chat . id ,
" Н е корректное название аккаунта" ,
)
if text in db . get . get_accounts ( engine , mes . from_user . id ) :
if text in db . get . get_account_name s ( engine , mes . from_user . id ) :
return await send_tmp_message (
bot , mes . chat . id , " Аккаунт с таким именем уже существует "
)
@ -332,7 +331,7 @@ async def get_account(bot: AsyncTeleBot, engine: Engine, mes: Message) -> None:
if master_pass is None :
return await send_tmp_message ( bot , mes . chat . id , " Нет мастер пароля " )
accounts = db . get . get_accounts (
accounts = db . get . get_account_name s (
engine ,
mes . from_user . id ,
to_sort = True ,
@ -355,7 +354,7 @@ async def _get_account2(
if text == " /cancel " :
return await send_tmp_message ( bot , mes . chat . id , " Успешная отмена " )
if text not in db . get . get_accounts ( engine , mes . from_user . id ) :
if text not in db . get . get_account_name s ( engine , mes . from_user . id ) :
return await send_tmp_message ( bot , mes . chat . id , " Нет такого аккаунта " )
bot_mes = await bot . send_message ( mes . chat . id , " Отправьте мастер пароль " )
@ -394,9 +393,9 @@ async def _get_account3(
await send_deleteable_message (
bot ,
mes . chat . id ,
f " Название: \n {escape ( account . name ) } \n "
f " Название: \n ` { account . name }` \n "
f " Логин: \n ` { account . login } ` \n Пароль: \n ` { account . password } ` \n Нажмите "
" на логин или пароль, чтобы скопировать " ,
" на название, логин или пароль, чтобы скопировать " ,
)
del text , mes
@ -414,7 +413,7 @@ async def delete_account(
if master_pass is None :
return await send_tmp_message ( bot , mes . chat . id , " Нет мастер пароля " )
accounts = db . get . get_accounts (
accounts = db . get . get_account_name s (
engine ,
mes . from_user . id ,
to_sort = True ,
@ -443,7 +442,7 @@ async def _delete_account2(
if text == " /cancel " :
return await send_tmp_message ( bot , mes . chat . id , " Успешная отмена " )
if text not in db . get . get_accounts ( engine , mes . from_user . id ) :
if text not in db . get . get_account_name s ( engine , mes . from_user . id ) :
return await send_tmp_message ( bot , mes . chat . id , " Нет такого аккаунта " )
bot_mes = await bot . send_message (
@ -502,7 +501,7 @@ async def export(bot: AsyncTeleBot, engine: Engine, mes: Message) -> None:
if master_password_from_db is None :
return await send_tmp_message ( bot , mes . chat . id , " Нет мастер пароля " )
if not db . get . get_accounts ( engine , mes . from_user . id ) :
if not db . get . get_account_name s ( engine , mes . from_user . id ) :
return await send_tmp_message ( bot , mes . chat . id , " Нет аккаунтов " )
bot_mes = await bot . send_message ( mes . chat . id , " Отправьте мастер пароль " )
@ -529,7 +528,7 @@ async def _export2(
" Н е подходит мастер пароль" ,
)
accounts = db . get . get_all_ accounts ( engine , mes . from_user . id )
accounts = db . get . get_accounts ( engine , mes . from_user . id )
with ProcessPoolExecutor ( ) as pool :
loop = asyncio . get_running_loop ( )
tasks = [ ]