missing LNBITS_ADMIN_EXTENSIONS and fix update bug

This commit is contained in:
dni ⚡ 2022-12-07 11:30:03 +01:00
parent c0fc53028b
commit 35536dde9b
3 changed files with 3 additions and 3 deletions

View File

@ -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} = ?")

View File

@ -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,

View File

@ -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)