diff --git a/lnbits/server.py b/lnbits/server.py index 4cb70870..79af8112 100644 --- a/lnbits/server.py +++ b/lnbits/server.py @@ -12,7 +12,7 @@ import time import click import uvicorn -from lnbits.settings import settings, set_cli_settings +from lnbits.settings import set_cli_settings, settings @click.command( diff --git a/lnbits/settings.py b/lnbits/settings.py index 85842034..a0b1fa68 100644 --- a/lnbits/settings.py +++ b/lnbits/settings.py @@ -151,10 +151,12 @@ if not settings.lnbits_admin_ui: for key, value in settings.dict(exclude_none=True).items(): logger.debug(f"{key}: {value}") + def set_cli_settings(**kwargs): for key, value in kwargs.items(): setattr(settings, key, value) + async def check_admin_settings(): if settings.lnbits_admin_ui: try: diff --git a/tests/conftest.py b/tests/conftest.py index 37c691f3..46282f0c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -28,7 +28,7 @@ def app(event_loop): # use redefined version of the event loop for scope="session" # loop = asyncio.get_event_loop() loop = event_loop - #loop.run_until_complete(migrate_databases()) + loop.run_until_complete(migrate_databases()) yield app # # get the current event loop and gracefully stop any running tasks # loop = event_loop diff --git a/tools/conv.py b/tools/conv.py index 9d8886a0..254d1ae3 100644 --- a/tools/conv.py +++ b/tools/conv.py @@ -4,6 +4,7 @@ import sqlite3 from typing import List import psycopg2 + from lnbits.settings import settings # Python script to migrate an LNbits SQLite DB to Postgres