From 8c93aa304f0d484e908cd40c0a851b95fbbfd992 Mon Sep 17 00:00:00 2001 From: Tiago vasconcelos Date: Tue, 22 Mar 2022 11:41:11 +0000 Subject: [PATCH] cleanup --- lnbits/extensions/admin/crud.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lnbits/extensions/admin/crud.py b/lnbits/extensions/admin/crud.py index 683558f9..e14ad194 100644 --- a/lnbits/extensions/admin/crud.py +++ b/lnbits/extensions/admin/crud.py @@ -1,9 +1,7 @@ -import json -from typing import List, Optional +from typing import List from lnbits.core.crud import create_payment from lnbits.helpers import urlsafe_short_hash -from lnbits.settings import * from lnbits.tasks import internal_invoice_queue from . import db @@ -37,14 +35,6 @@ async def update_admin(user: str, **kwargs) -> Admin: assert row, "Newly updated settings couldn't be retrieved" return Admin(**row) if row else None -# async def update_admin(user: str, **kwargs) -> Optional[Admin]: -# q = ", ".join([f"{field[0]} = ?" for field in kwargs.items()]) -# await db.execute( -# f"UPDATE admin SET {q} WHERE user = ?", (*kwargs.values(), user) -# ) -# new_settings = await get_admin() -# return new_settings - async def get_admin() -> Admin: row = await db.fetchone("SELECT * FROM admin") return Admin(**row) if row else None