Fix: "Insufficient Funds" when user has exact amount
This commit is contained in:
1 parent
ff09985944
commit
d5de4597c3
1 file changed
+1
-1
@@ -66,7 +66,7 @@ def create_order(customer_id: ID, order_lines: List[OrderLineInput], is_external
|
|||||||
product.inventory_amount -= ol.amount
|
product.inventory_amount -= ol.amount
|
||||||
product.save()
|
product.save()
|
||||||
|
|
||||||
if not is_external and user.profile.balance <= order_sum:
|
if not is_external and user.profile.balance < order_sum:
|
||||||
return InsufficientFunds(
|
return InsufficientFunds(
|
||||||
message="Du har ikke nok penger på bok.", amount_lacking=abs(order_sum - user.profile.balance)
|
message="Du har ikke nok penger på bok.", amount_lacking=abs(order_sum - user.profile.balance)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user