clean up if clause
This commit is contained in:
parent
269ea0f975
commit
07724eaa0f
1 changed files with 2 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue