From 8c2f381d1ae88563b1c72dcb8ee41d5f7ff494a9 Mon Sep 17 00:00:00 2001 From: Joe <1264204425@qq.com> Date: Thu, 12 Sep 2024 11:10:02 +0800 Subject: [PATCH] feat: add create_owner_tenant_if_not_exist WorkSpaceNotAllowedCreateError --- api/controllers/console/auth/oauth.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/controllers/console/auth/oauth.py b/api/controllers/console/auth/oauth.py index ff0407d5fb..e446878488 100644 --- a/api/controllers/console/auth/oauth.py +++ b/api/controllers/console/auth/oauth.py @@ -112,6 +112,10 @@ class OAuthCallback(Resource): TenantService.create_owner_tenant_if_not_exist(account) except Unauthorized: return redirect(f"{dify_config.CONSOLE_WEB_URL}/signin?message=WorkspaceNotFound") + except WorkSpaceNotAllowedCreateError: + return redirect( + f"{dify_config.CONSOLE_WEB_URL}/signin?message=Workspace not found, please contact system admin to invite you to join in a workspace." + ) token = AccountService.login(account, ip_address=get_remote_ip(request))