diff --git a/api/controllers/console/auth/forgot_password.py b/api/controllers/console/auth/forgot_password.py index 176fe6049f..1a88d7d5d7 100644 --- a/api/controllers/console/auth/forgot_password.py +++ b/api/controllers/console/auth/forgot_password.py @@ -111,7 +111,7 @@ class ForgotPasswordResetApi(Resource): tenant = TenantService.get_join_tenants(account) if not tenant: if not dify_config.ALLOW_CREATE_WORKSPACE: - return NotAllowedCreateWorkspace() + raise NotAllowedCreateWorkspace() else: tenant = TenantService.create_tenant(f"{account.name}'s Workspace") TenantService.create_tenant_member(tenant, account, role="owner") diff --git a/api/controllers/console/auth/login.py b/api/controllers/console/auth/login.py index 7c02a64909..052a207a71 100644 --- a/api/controllers/console/auth/login.py +++ b/api/controllers/console/auth/login.py @@ -135,7 +135,7 @@ class EmailCodeLoginApi(Resource): tenant = TenantService.get_join_tenants(account) if not tenant: if not dify_config.ALLOW_CREATE_WORKSPACE: - return NotAllowedCreateWorkspace() + raise NotAllowedCreateWorkspace() else: tenant = TenantService.create_tenant(f"{account.name}'s Workspace") TenantService.create_tenant_member(tenant, account, role="owner")