diff --git a/handlers/admin/gifts/gifts_handler.py b/handlers/admin/gifts/gifts_handler.py index 9eb35214..f9bedbfd 100644 --- a/handlers/admin/gifts/gifts_handler.py +++ b/handlers/admin/gifts/gifts_handler.py @@ -32,7 +32,7 @@ async def admin_gift_menu(callback: CallbackQuery): @router.callback_query(F.data == "admin_gift_create") async def admin_create_gift_step1(callback: CallbackQuery, session: AsyncSession): - stmt = select(Tariff).where(Tariff.group_code == "gifts", Tariff.is_active is True).order_by(Tariff.duration_days) + stmt = select(Tariff).where(Tariff.group_code == "gifts", Tariff.is_active.is_(True)).order_by(Tariff.duration_days) result = await session.execute(stmt) tariffs = result.scalars().all() @@ -83,7 +83,7 @@ async def admin_gift_show_tariffs_in_subgroup(callback: CallbackQuery, session: return stmt = ( - select(Tariff).where(Tariff.group_code == "gifts", Tariff.is_active is True).order_by(Tariff.duration_days) + select(Tariff).where(Tariff.group_code == "gifts", Tariff.is_active.is_(True)).order_by(Tariff.duration_days) ) result = await session.execute(stmt) tariffs = result.scalars().all() diff --git a/handlers/admin/users/users_handler.py b/handlers/admin/users/users_handler.py index e1240e11..710eb5f7 100644 --- a/handlers/admin/users/users_handler.py +++ b/handlers/admin/users/users_handler.py @@ -657,7 +657,7 @@ async def handle_user_choose_tariff( await state.set_state(RenewTariffState.selecting_tariff) result = await session.execute( - select(Tariff).where(Tariff.group_code == group_code, Tariff.is_active is True).order_by(Tariff.id) + select(Tariff).where(Tariff.group_code == group_code, Tariff.is_active.is_(True)).order_by(Tariff.id) ) tariffs = result.scalars().all() diff --git a/handlers/keys/key_utils.py b/handlers/keys/key_utils.py index 48524906..e76bdda3 100644 --- a/handlers/keys/key_utils.py +++ b/handlers/keys/key_utils.py @@ -300,7 +300,7 @@ async def renew_key_in_cluster( if tariff_group_row: result = await session.execute( select(Tariff) - .where(Tariff.group_code == tariff_group_row, Tariff.is_active is True) + .where(Tariff.group_code == tariff_group_row, Tariff.is_active.is_(True)) .order_by(Tariff.duration_days.desc()) .limit(1) ) @@ -554,7 +554,7 @@ async def update_key_on_cluster( result = await session.execute( select(Tariff) - .where(Tariff.group_code == group_code, Tariff.is_active is True) + .where(Tariff.group_code == group_code, Tariff.is_active.is_(True)) .order_by(Tariff.duration_days.desc()) .limit(1) ) @@ -614,7 +614,7 @@ async def update_key_on_cluster( result = await session.execute( select(Tariff) - .where(Tariff.group_code == group_code, Tariff.is_active is True) + .where(Tariff.group_code == group_code, Tariff.is_active.is_(True)) .order_by(Tariff.duration_days.desc()) .limit(1) )