mirror of
https://github.com/lnbits/lnbits.git
synced 2025-05-03 16:20:16 +02:00
clean up if clause
This commit is contained in:
parent
269ea0f975
commit
07724eaa0f
@ -178,14 +178,13 @@ class Payment(BaseModel):
|
|||||||
|
|
||||||
logger.debug(f"Status: {status}")
|
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)
|
expiration_date = datetime.datetime.fromtimestamp(self.expiry)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"Deleting expired incoming pending payment {self.checking_id}: expired {expiration_date}"
|
f"Deleting expired incoming pending payment {self.checking_id}: expired {expiration_date}"
|
||||||
)
|
)
|
||||||
await self.delete(conn)
|
await self.delete(conn)
|
||||||
|
elif self.is_out and status.failed:
|
||||||
if self.is_out and status.failed:
|
|
||||||
logger.warning(
|
logger.warning(
|
||||||
f"Deleting outgoing failed payment {self.checking_id}: {status}"
|
f"Deleting outgoing failed payment {self.checking_id}: {status}"
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user