From d5de4597c39a52e40ceeb8caf2d3fd8fa00bc387 Mon Sep 17 00:00:00 2001 From: Emma Eilefsen Glenna Date: Thu, 28 Sep 2023 22:51:08 +0200 Subject: [PATCH] Fix: "Insufficient Funds" when user has exact amount --- bbs/api/mutations/shop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bbs/api/mutations/shop.py b/bbs/api/mutations/shop.py index cc1ad97..79bf91c 100644 --- a/bbs/api/mutations/shop.py +++ b/bbs/api/mutations/shop.py @@ -66,7 +66,7 @@ def create_order(customer_id: ID, order_lines: List[OrderLineInput], is_external product.inventory_amount -= ol.amount product.save() - if not is_external and user.profile.balance <= order_sum: + if not is_external and user.profile.balance < order_sum: return InsufficientFunds( message="Du har ikke nok penger på bok.", amount_lacking=abs(order_sum - user.profile.balance) )