mirror of
https://github.com/lnbits/lnbits.git
synced 2025-07-08 14:30:43 +02:00
Fix user label across lnbits (#1771)
* check for super user on get_user * remove unecessary assingments
This commit is contained in:
committed by
GitHub
parent
339645a912
commit
758a4ecaf6
@ -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,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user