diff --git a/apps/wallet/models.py b/apps/wallet/models.py index 057945b..2e8d565 100755 --- a/apps/wallet/models.py +++ b/apps/wallet/models.py @@ -234,7 +234,7 @@ class Transaction(BaseModel): raise UnprocessableEntity('not enough balance') if not payer_is_allowed_negative_balance: - updated = Account.objects.filter(pk=self.payer_account.pk, balance__gt=self.amount).update(balance=F('balance') - self.amount) + updated = Account.objects.filter(pk=self.payer_account.pk, balance__gte=self.amount).update(balance=F('balance') - self.amount) else: updated = Account.objects.filter(pk=self.payer_account.pk).update(balance=F('balance') - self.amount)