From 148747c3c6ba3378628c98c75ce6180fa7af3a9e Mon Sep 17 00:00:00 2001 From: Joe <1264204425@qq.com> Date: Tue, 10 Sep 2024 13:47:10 +0800 Subject: [PATCH] fix: raise --- api/controllers/console/auth/forgot_password.py | 2 +- api/controllers/console/auth/login.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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")