diff --git a/lnbits/core/crud.py b/lnbits/core/crud.py index a57d054db..24fdefff2 100644 --- a/lnbits/core/crud.py +++ b/lnbits/core/crud.py @@ -231,8 +231,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, ) diff --git a/lnbits/core/models.py b/lnbits/core/models.py index 56ed27e1b..7e5930f3b 100644 --- a/lnbits/core/models.py +++ b/lnbits/core/models.py @@ -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""" diff --git a/pyproject.toml b/pyproject.toml index 10e83544d..4944d9a81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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]