2
0
forked from kodorvan/stcs
This commit is contained in:
algizn97
2025-10-04 09:34:11 +05:00
parent 163f4dcba9
commit 220c45d54c
3 changed files with 51 additions and 18 deletions

View File

@@ -1268,7 +1268,7 @@ async def get_all_user_auto_trading(tg_id: int):
return []
async def get_user_auto_trading(tg_id: int, symbol: str):
async def get_user_auto_trading(tg_id: int, symbol: str, side: str):
"""Get user auto trading from the database asynchronously."""
try:
async with async_session() as session:
@@ -1278,7 +1278,7 @@ async def get_user_auto_trading(tg_id: int, symbol: str):
return None
result_auto_trading = await session.execute(
select(UserAutoTrading).filter_by(user_id=user.id, symbol=symbol)
select(UserAutoTrading).filter_by(user_id=user.id, symbol=symbol, side=side)
)
auto_trading = result_auto_trading.scalars().first()
return auto_trading