feat: add create_owner_tenant_if_not_exist WorkSpaceNotAllowedCreateError

This commit is contained in:
Joe 2024-09-12 11:10:02 +08:00
parent dc0caab45c
commit 8c2f381d1a
1 changed files with 4 additions and 0 deletions

View File

@ -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))