From 30ab42c0b2f5b843d848cbb8c5594c5a2f0b2e3f Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 29 Jan 2026 17:04:24 +0200 Subject: [PATCH] feat: add back toggle admin --- lnbits/core/views/user_api.py | 4 ++-- lnbits/static/i18n/en.js | 2 ++ lnbits/templates/pages/users.vue | 24 ++++++++++++++++++++++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/lnbits/core/views/user_api.py b/lnbits/core/views/user_api.py index 3f125231f..7fd5b66ec 100644 --- a/lnbits/core/views/user_api.py +++ b/lnbits/core/views/user_api.py @@ -75,7 +75,7 @@ async def api_get_users( summary="Get user by Id", ) async def api_get_user(user_id: str) -> User: - user = await get_user(user_id) + user = await get_user(user_id, activated=None) if not user: raise HTTPException(HTTPStatus.NOT_FOUND, "User not found.") return user @@ -237,7 +237,7 @@ async def api_users_toggle_activated( if user_id == account.id: raise HTTPException( status_code=HTTPStatus.BAD_REQUEST, - detail="Users cannot deactivate themselves.", + detail="You cannot deactivate yourself.", ) if settings.is_admin_user(user_id): diff --git a/lnbits/static/i18n/en.js b/lnbits/static/i18n/en.js index 4197de371..17152dc55 100644 --- a/lnbits/static/i18n/en.js +++ b/lnbits/static/i18n/en.js @@ -188,6 +188,8 @@ window.localisation.en = { only_admins_can_create_extensions: 'Only admin accounts can create extensions', admin_only: 'Admin Only', + make_user_admin: 'Make User Admin', + revoke_admin: 'Revoke Admin', new_version: 'New Version', reviews_url: 'Reviews URL', reviews_url_label: 'Reviews server URL', diff --git a/lnbits/templates/pages/users.vue b/lnbits/templates/pages/users.vue index 8e07e767a..a8df5aed9 100644 --- a/lnbits/templates/pages/users.vue +++ b/lnbits/templates/pages/users.vue @@ -218,6 +218,26 @@ :label="$t('update_account')" class="q-ml-md" > + + + + +