From 35536dde9bd59d907635296d02ed1bc167af234e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Wed, 7 Dec 2022 11:30:03 +0100 Subject: [PATCH] missing LNBITS_ADMIN_EXTENSIONS and fix update bug --- lnbits/extensions/admin/crud.py | 3 --- lnbits/extensions/admin/migrations.py | 1 + lnbits/extensions/admin/models.py | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lnbits/extensions/admin/crud.py b/lnbits/extensions/admin/crud.py index ba9df604..090b2c0f 100644 --- a/lnbits/extensions/admin/crud.py +++ b/lnbits/extensions/admin/crud.py @@ -58,9 +58,6 @@ async def update_admin_settings(data: UpdateSettings): def get_q_and_values(data): keys = [] values = [] - # exclude from api updates - data.pop("lnbits_allowed_funding_sources") - data.pop("super_user") for key, value in data.items(): setattr(settings, key, value) keys.append(f"{key} = ?") diff --git a/lnbits/extensions/admin/migrations.py b/lnbits/extensions/admin/migrations.py index 434ba200..b5ec1730 100644 --- a/lnbits/extensions/admin/migrations.py +++ b/lnbits/extensions/admin/migrations.py @@ -3,6 +3,7 @@ async def m001_create_admin_settings_table(db): """ CREATE TABLE IF NOT EXISTS admin.settings ( super_user TEXT, + lnbits_admin_extensions TEXT, lnbits_admin_users TEXT, lnbits_allowed_users TEXT, lnbits_disabled_extensions TEXT, diff --git a/lnbits/extensions/admin/models.py b/lnbits/extensions/admin/models.py index 408f7c21..965a28dc 100644 --- a/lnbits/extensions/admin/models.py +++ b/lnbits/extensions/admin/models.py @@ -10,6 +10,7 @@ class UpdateSettings(BaseModel, extra=Extra.forbid): "lnbits_allowed_users", "lnbits_theme_options", "lnbits_disabled_extensions", + "lnbits_admin_extensions", pre=True, ) def validate(cls, val): @@ -20,6 +21,7 @@ class UpdateSettings(BaseModel, extra=Extra.forbid): lnbits_backend_wallet_class: str = Query(None) lnbits_admin_users: List[str] = Query(None) lnbits_allowed_users: List[str] = Query(None) + lnbits_admin_extensions: List[str] = Query(None) lnbits_disabled_extensions: List[str] = Query(None) lnbits_theme_options: List[str] = Query(None) lnbits_force_https: bool = Query(None)