From 620325b39909bd17a50753db89ef7db4fd893d4e Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 3 Oct 2024 14:07:44 +0300 Subject: [PATCH] fix: lint --- 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 816230e26..7d5b7b18a 100644 --- a/lnbits/core/models.py +++ b/lnbits/core/models.py @@ -3,7 +3,6 @@ from __future__ import annotations import hashlib import hmac import json -import time from dataclasses import dataclass from datetime import datetime, timezone from enum import Enum @@ -34,7 +33,7 @@ def json_custom_serialization(_, o): raise TypeError(f"Object is not JSON serializable: {o}") -json.JSONEncoder.default = json_custom_serialization +json.JSONEncoder.default = json_custom_serialization # type: ignore[method-assign] class BaseWallet(BaseModel): @@ -333,7 +332,7 @@ class Payment(BaseModel): @property def is_expired(self) -> bool: - return self.expiry < time.time() if self.expiry else False + return self.expiry < datetime.now(timezone.utc) if self.expiry else False @property def is_internal(self) -> bool: