chore: refurish python code by applying Pylint linter rules (#8322)
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user