From c637e8d31eb897599b97e02b3de02b1654b3c5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Mon, 16 Sep 2024 20:43:17 +0200 Subject: [PATCH] fix: internal payment can still be pending (#2686) bug introduced last commit --- lnbits/core/models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lnbits/core/models.py b/lnbits/core/models.py index 24bae0d7..f1da2001 100644 --- a/lnbits/core/models.py +++ b/lnbits/core/models.py @@ -21,6 +21,8 @@ from lnbits.settings import settings from lnbits.utils.exchange_rates import allowed_currencies from lnbits.wallets import get_funding_source from lnbits.wallets.base import ( + PaymentFailedStatus, + PaymentPendingStatus, PaymentStatus, PaymentSuccessStatus, ) @@ -290,7 +292,11 @@ class Payment(FromRowModel): async def check_status(self) -> PaymentStatus: if self.is_internal: - return PaymentSuccessStatus() + if self.success: + return PaymentSuccessStatus() + if self.failed: + return PaymentFailedStatus() + return PaymentPendingStatus() funding_source = get_funding_source() if self.is_out: status = await funding_source.get_payment_status(self.checking_id)