fix: --name option for the create-tenant command does not take effect (#11993)

This commit is contained in:
eux
2024-12-24 21:58:05 +08:00
committed by GitHub
parent cdaef30cc9
commit 49bc602fb2
2 changed files with 9 additions and 3 deletions

View File

@@ -797,6 +797,7 @@ class RegisterService:
language: Optional[str] = None,
status: Optional[AccountStatus] = None,
is_setup: Optional[bool] = False,
create_workspace_required: Optional[bool] = True,
) -> Account:
db.session.begin_nested()
"""Register account"""
@@ -814,7 +815,7 @@ class RegisterService:
if open_id is not None and provider is not None:
AccountService.link_account_integrate(provider, open_id, account)
if FeatureService.get_system_features().is_allow_create_workspace:
if FeatureService.get_system_features().is_allow_create_workspace and create_workspace_required:
tenant = TenantService.create_tenant(f"{account.name}'s Workspace")
TenantService.create_tenant_member(tenant, account, role="owner")
account.current_tenant = tenant