From 07724eaa0f48c149f93c9d00c4e2db4a3f88f7aa Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Tue, 6 Dec 2022 13:21:34 +0100 Subject: [PATCH] clean up if clause --- lnbits/core/models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lnbits/core/models.py b/lnbits/core/models.py index e9a014ce..62f8aa39 100644 --- a/lnbits/core/models.py +++ b/lnbits/core/models.py @@ -178,14 +178,13 @@ class Payment(BaseModel): logger.debug(f"Status: {status}") - if self.is_in and self.expiry and status.pending and self.is_expired: + if self.is_in and status.pending and self.is_expired and self.expiry: expiration_date = datetime.datetime.fromtimestamp(self.expiry) logger.debug( f"Deleting expired incoming pending payment {self.checking_id}: expired {expiration_date}" ) await self.delete(conn) - - if self.is_out and status.failed: + elif self.is_out and status.failed: logger.warning( f"Deleting outgoing failed payment {self.checking_id}: {status}" )