Skip to content

Commit

Permalink
Fix placed order for test service with total 0
Browse files Browse the repository at this point in the history
  • Loading branch information
eloravpn committed Dec 6, 2024
1 parent dcfad8c commit c99b1c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/commerce/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c99b1c6

Please sign in to comment.