chore: refurish python code by applying Pylint linter rules (#8322)
This commit is contained in:
parent
1ab81b4972
commit
a1104ab97e
126 changed files with 253 additions and 272 deletions
|
|
@ -47,7 +47,7 @@ class AccountService:
|
|||
if not account:
|
||||
return None
|
||||
|
||||
if account.status in [AccountStatus.BANNED.value, AccountStatus.CLOSED.value]:
|
||||
if account.status in {AccountStatus.BANNED.value, AccountStatus.CLOSED.value}:
|
||||
raise Unauthorized("Account is banned or closed.")
|
||||
|
||||
current_tenant: TenantAccountJoin = TenantAccountJoin.query.filter_by(
|
||||
|
|
@ -92,7 +92,7 @@ class AccountService:
|
|||
if not account:
|
||||
raise AccountLoginError("Invalid email or password.")
|
||||
|
||||
if account.status == AccountStatus.BANNED.value or account.status == AccountStatus.CLOSED.value:
|
||||
if account.status in {AccountStatus.BANNED.value, AccountStatus.CLOSED.value}:
|
||||
raise AccountLoginError("Account is banned or closed.")
|
||||
|
||||
if account.status == AccountStatus.PENDING.value:
|
||||
|
|
@ -427,7 +427,7 @@ class TenantService:
|
|||
"remove": [TenantAccountRole.OWNER],
|
||||
"update": [TenantAccountRole.OWNER],
|
||||
}
|
||||
if action not in ["add", "remove", "update"]:
|
||||
if action not in {"add", "remove", "update"}:
|
||||
raise InvalidActionError("Invalid action.")
|
||||
|
||||
if member:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue