From 75e07b21c7cc34687207426d3b33cbc784f84561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Mon, 14 Oct 2024 10:06:13 +0200 Subject: [PATCH] vlad --- lnbits/core/migrations.py | 2 ++ lnbits/core/models.py | 10 ---------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lnbits/core/migrations.py b/lnbits/core/migrations.py index a11e14984..ecfe20bee 100644 --- a/lnbits/core/migrations.py +++ b/lnbits/core/migrations.py @@ -562,6 +562,8 @@ async def m023_add_column_column_to_apipayments(db): await db.execute("ALTER TABLE apipayments RENAME COLUMN wallet TO wallet_id") await db.execute("ALTER TABLE accounts RENAME COLUMN pass TO password_hash") + await db.execute("CREATE INDEX by_hash ON apipayments (payment_hash)") + async def m024_drop_pending(db): await db.execute("ALTER TABLE apipayments DROP COLUMN pending") diff --git a/lnbits/core/models.py b/lnbits/core/models.py index 7d5b7b18a..0cd25e27e 100644 --- a/lnbits/core/models.py +++ b/lnbits/core/models.py @@ -2,7 +2,6 @@ from __future__ import annotations import hashlib import hmac -import json from dataclasses import dataclass from datetime import datetime, timezone from enum import Enum @@ -27,15 +26,6 @@ from lnbits.wallets.base import ( ) -def json_custom_serialization(_, o): - if isinstance(o, datetime): - return o.isoformat() - raise TypeError(f"Object is not JSON serializable: {o}") - - -json.JSONEncoder.default = json_custom_serialization # type: ignore[method-assign] - - class BaseWallet(BaseModel): id: str name: str