diff --git a/lnbits/db.py b/lnbits/db.py index 5cae12506..878108106 100644 --- a/lnbits/db.py +++ b/lnbits/db.py @@ -175,7 +175,9 @@ class Connection(Compat): return dict_to_model(row, model) return row - async def update(self, table_name: str, model: BaseModel, where: str = "id = :id"): + async def update( + self, table_name: str, model: BaseModel, where: str = "WHERE id = :id" + ): await self.conn.execute( text(update_query(table_name, model, where)), model_to_dict(model) ) @@ -341,7 +343,7 @@ class Database(Compat): await conn.insert(table_name, model) async def update( - self, table_name: str, model: BaseModel, where: str = "id = :id" + self, table_name: str, model: BaseModel, where: str = "WHERE id = :id" ) -> None: async with self.connect() as conn: await conn.update(table_name, model, where)