fixup!
This commit is contained in:
+2
-2
@@ -231,8 +231,8 @@ async def get_user(account: Account, conn: Optional[Connection] = None) -> User:
|
|||||||
updated_at=account.updated_at,
|
updated_at=account.updated_at,
|
||||||
extensions=extensions,
|
extensions=extensions,
|
||||||
wallets=wallets,
|
wallets=wallets,
|
||||||
admin=account.is_super_user or account.is_admin or False,
|
admin=account.is_admin,
|
||||||
super_user=account.is_super_user or False,
|
super_user=account.is_super_user,
|
||||||
has_password=account.password_hash is not None,
|
has_password=account.password_hash is not None,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ class Account(BaseModel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def is_admin(self) -> bool:
|
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:
|
def hash_password(self, password: str) -> str:
|
||||||
"""sets and returns the hashed password"""
|
"""sets and returns the hashed password"""
|
||||||
|
|||||||
@@ -201,6 +201,7 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
|||||||
[tool.ruff.lint.pep8-naming]
|
[tool.ruff.lint.pep8-naming]
|
||||||
classmethod-decorators = [
|
classmethod-decorators = [
|
||||||
"root_validator",
|
"root_validator",
|
||||||
|
"validator",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.ruff.lint.mccabe]
|
[tool.ruff.lint.mccabe]
|
||||||
|
|||||||
Reference in New Issue
Block a user