From 6d6a71a2697cffb674c7d37ca23940f3f9c6e2ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Thu, 26 Sep 2024 09:40:42 +0200 Subject: [PATCH] fixup! --- lnbits/db.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lnbits/db.py b/lnbits/db.py index 2d34836bc..ad684e0e5 100644 --- a/lnbits/db.py +++ b/lnbits/db.py @@ -159,16 +159,14 @@ class Connection(Compat): return row async def update(self, table_name: str, model: BaseModel, where: str = "id = :id"): - result = await self.conn.execute( + await self.conn.execute( text(update_query(table_name, model, where)), model.dict() ) - result.close() + await self.conn.commit() async def insert(self, table_name: str, model: BaseModel): - result = await self.conn.execute( - text(insert_query(table_name, model)), model.dict() - ) - result.close() + await self.conn.execute(text(insert_query(table_name, model)), model.dict()) + await self.conn.commit() async def fetch_page( self,