Fix user label across lnbits (#1771)

* check for super user on get_user
* remove unecessary assingments
This commit is contained in:
Tiago Vasconcelos
2023-06-20 07:41:57 +01:00
committed by GitHub
parent 339645a912
commit 758a4ecaf6
2 changed files with 1 additions and 4 deletions

View File

@ -75,6 +75,7 @@ async def get_user(user_id: str, conn: Optional[Connection] = None) -> Optional[
wallets=[Wallet(**w) for w in wallets], wallets=[Wallet(**w) for w in wallets],
admin=user["id"] == settings.super_user admin=user["id"] == settings.super_user
or user["id"] in settings.lnbits_admin_users, or user["id"] in settings.lnbits_admin_users,
super_user=user["id"] == settings.super_user,
) )

View File

@ -259,10 +259,6 @@ async def check_admin(usr: UUID4) -> User:
status_code=HTTPStatus.UNAUTHORIZED, status_code=HTTPStatus.UNAUTHORIZED,
detail="User not authorized. No admin privileges.", detail="User not authorized. No admin privileges.",
) )
user.admin = True
user.super_user = False
if user.id == settings.super_user:
user.super_user = True
return user return user