From 08e54de99b72eec2c8f7850ef0d346c15bf64705 Mon Sep 17 00:00:00 2001 From: Tiago vasconcelos Date: Mon, 16 May 2022 12:53:47 +0100 Subject: [PATCH] fix sqlite and show user account --- lnbits/app.py | 1 + lnbits/commands.py | 2 +- lnbits/extensions/admin/migrations.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lnbits/app.py b/lnbits/app.py index 5df439dc..f066163f 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -117,6 +117,7 @@ def check_settings(app: FastAPI): while True: admin_set = await get_admin_settings() if admin_set : + print(f"Access admin user account at: http://{lnbits.settings.HOST}:{lnbits.settings.PORT}/wallet?usr={admin_set.user}") break print("ERROR:", admin_set) await asyncio.sleep(5) diff --git a/lnbits/commands.py b/lnbits/commands.py index 7d9b49e2..763a5b90 100644 --- a/lnbits/commands.py +++ b/lnbits/commands.py @@ -69,7 +69,7 @@ async def get_admin_settings(): exists = await conn.fetchone( "SELECT * FROM information_schema.tables WHERE table_name = 'admin'" ) - print("EXISTS", exists) + if not exists: return False diff --git a/lnbits/extensions/admin/migrations.py b/lnbits/extensions/admin/migrations.py index c94d140b..6c5b507d 100644 --- a/lnbits/extensions/admin/migrations.py +++ b/lnbits/extensions/admin/migrations.py @@ -15,6 +15,7 @@ async def get_admin_user(): user = account.id assert user, "Newly created user couldn't be retrieved" print(f"Your newly created account/user id is: {user}. This will be the Super Admin user.") + conf.admin_users.insert(0, user) return user