fix: add workspace limitation in invite-login API (#18724)

This commit is contained in:
Xin Zhang 2025-04-25 09:52:47 +08:00 committed by GitHub
parent f45321dd27
commit b786bbdab5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -893,7 +893,10 @@ 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 and create_workspace_required:
if (FeatureService.get_system_features().is_allow_create_workspace
and create_workspace_required
and FeatureService.get_system_features().license.workspaces.is_available()
):
tenant = TenantService.create_tenant(f"{account.name}'s Workspace")
TenantService.create_tenant_member(tenant, account, role="owner")
account.current_tenant = tenant