invoice payment! prerelease
This commit is contained in:
@@ -126,29 +126,6 @@ class OrderService:
|
||||
|
||||
return order_item.quantity
|
||||
|
||||
async def clear_cart_item(
|
||||
self, session: AsyncSession, *, customer: int, product_id: int
|
||||
) -> None:
|
||||
order = await self.order_repo.get_draft_order_by_user(session, customer)
|
||||
|
||||
if not order:
|
||||
raise OrderServiceException(
|
||||
"attempt of clearing a non-existing cart, potential callback_query exploit, ignoring..."
|
||||
)
|
||||
|
||||
order_item = await self.order_items_repo.get_item_by_order_and_product(
|
||||
session, order_id=order.id, product_id=product_id
|
||||
)
|
||||
|
||||
if not order_item:
|
||||
raise OrderServiceException(
|
||||
"attempt of clearing an order_item that isn't in a cart, potential callback_query exploit, ignoring..."
|
||||
)
|
||||
|
||||
await self.order_items_repo.update_order_item_quantity(
|
||||
session, order_item_id=order_item.id, quantity=0
|
||||
)
|
||||
|
||||
async def build_pagination_cart_dto(
|
||||
self,
|
||||
session: AsyncSession,
|
||||
|
||||
Reference in New Issue
Block a user