From 2a17d5a8ceaaac7cac861f0ac944911b44d1aa69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Fri, 27 Sep 2024 12:05:02 +0200 Subject: [PATCH] fixup! --- lnbits/core/crud.py | 4 ++-- lnbits/core/models.py | 2 +- pyproject.toml | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) 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]