From ffd93c9dfaac8a6866571795cc9c2a30ef85c2e0 Mon Sep 17 00:00:00 2001 From: Nikita Melkozerov Date: Mon, 4 Mar 2024 17:58:12 +0000 Subject: [PATCH] fix the aws_marketplace_subscription method --- fixbackend/subscription/subscription_repository.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fixbackend/subscription/subscription_repository.py b/fixbackend/subscription/subscription_repository.py index 35a9dbc5..fa76f473 100644 --- a/fixbackend/subscription/subscription_repository.py +++ b/fixbackend/subscription/subscription_repository.py @@ -123,9 +123,10 @@ async def aws_marketplace_subscription( self, user_id: UserId, customer_identifier: str ) -> Optional[AwsMarketplaceSubscription]: async with self.session_maker() as session: - stmt = select(SubscriptionEntity).where( - SubscriptionEntity.aws_customer_identifier == customer_identifier - and SubscriptionEntity.user_id == user_id + stmt = ( + select(SubscriptionEntity) + .where(SubscriptionEntity.aws_customer_identifier == customer_identifier) + .where(SubscriptionEntity.user_id == user_id) ) if result := (await session.execute(stmt)).scalar_one_or_none(): return result.to_model()