mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-15 12:20:21 +01:00
fix sqlite and show user account
This commit is contained in:
parent
2f2d70f9a8
commit
08e54de99b
3 changed files with 3 additions and 1 deletions
|
@ -117,6 +117,7 @@ def check_settings(app: FastAPI):
|
||||||
while True:
|
while True:
|
||||||
admin_set = await get_admin_settings()
|
admin_set = await get_admin_settings()
|
||||||
if admin_set :
|
if admin_set :
|
||||||
|
print(f"Access admin user account at: http://{lnbits.settings.HOST}:{lnbits.settings.PORT}/wallet?usr={admin_set.user}")
|
||||||
break
|
break
|
||||||
print("ERROR:", admin_set)
|
print("ERROR:", admin_set)
|
||||||
await asyncio.sleep(5)
|
await asyncio.sleep(5)
|
||||||
|
|
|
@ -69,7 +69,7 @@ async def get_admin_settings():
|
||||||
exists = await conn.fetchone(
|
exists = await conn.fetchone(
|
||||||
"SELECT * FROM information_schema.tables WHERE table_name = 'admin'"
|
"SELECT * FROM information_schema.tables WHERE table_name = 'admin'"
|
||||||
)
|
)
|
||||||
print("EXISTS", exists)
|
|
||||||
if not exists:
|
if not exists:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ async def get_admin_user():
|
||||||
user = account.id
|
user = account.id
|
||||||
assert user, "Newly created user couldn't be retrieved"
|
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.")
|
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
|
return user
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue