From c99b1c61db08d16264953a5bb5991d7393d880a9 Mon Sep 17 00:00:00 2001 From: Elora VPN Date: Fri, 6 Dec 2024 23:01:45 +0330 Subject: [PATCH] Fix placed order for test service with total 0 --- src/commerce/service.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commerce/service.py b/src/commerce/service.py index 510aca7..e4a7c0e 100644 --- a/src/commerce/service.py +++ b/src/commerce/service.py @@ -584,8 +584,10 @@ def _validate_order( ): total = db_order.total - db_order.total_discount_amount - if (db_user.balance is None or db_user.balance < total) and ( - (modify and not modify.is_debt) or not allow_debt + if ( + (db_user.balance is None or db_user.balance < total) + and ((modify and not modify.is_debt) or not allow_debt) + and total != 0 ): raise NoEnoughBalanceError(total=total)