This commit is contained in:
dni ⚡ 2024-09-27 12:05:02 +02:00 committed by Vlad Stan
parent d11df332b3
commit 03789176d9
3 changed files with 4 additions and 3 deletions

View File

@ -247,8 +247,8 @@ async def get_user(account: Account, conn: Optional[Connection] = None) -> User:
updated_at=account.updated_at,
extensions=extensions,
wallets=wallets,
admin=account.is_super_user or account.is_admin or False,
super_user=account.is_super_user or False,
admin=account.is_admin,
super_user=account.is_super_user,
has_password=account.password_hash is not None,
)

View File

@ -125,7 +125,7 @@ class Account(BaseModel):
@property
def is_admin(self) -> bool:
return self.id in settings.lnbits_admin_users
return self.id in settings.lnbits_admin_users or self.is_super_user
def hash_password(self, password: str) -> str:
"""sets and returns the hashed password"""

View File

@ -201,6 +201,7 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.pep8-naming]
classmethod-decorators = [
"root_validator",
"validator",
]
[tool.ruff.lint.mccabe]