mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 19:59:50 +08:00
feat: remove self-host
This commit is contained in:
parent
cd88f27cd5
commit
067955c2b1
|
@ -188,15 +188,7 @@ class AccountService:
|
|||
email=email, name=name, interface_language=interface_language, password=password
|
||||
)
|
||||
|
||||
# SELF_HOSTED Just create account, not create tenant
|
||||
if dify_config.EDITION != "SELF_HOSTED":
|
||||
TenantService.create_owner_tenant_if_not_exist(account=account)
|
||||
else:
|
||||
# SElF_HOST just have one tenant
|
||||
tenant = Tenant.query.first()
|
||||
TenantService.create_tenant_member(tenant, account, role="user")
|
||||
account.current_tenant = tenant
|
||||
db.session.commit()
|
||||
TenantService.create_owner_tenant_if_not_exist(account=account)
|
||||
|
||||
return account
|
||||
|
||||
|
@ -684,18 +676,12 @@ class RegisterService:
|
|||
if open_id is not None or provider is not None:
|
||||
AccountService.link_account_integrate(provider, open_id, account)
|
||||
|
||||
if dify_config.EDITION != "SELF_HOSTED":
|
||||
if not dify_config.ALLOW_CREATE_WORKSPACE:
|
||||
raise WorkSpaceNotAllowedCreateError()
|
||||
tenant = TenantService.create_tenant(f"{account.name}'s Workspace")
|
||||
TenantService.create_tenant_member(tenant, account, role="owner")
|
||||
account.current_tenant = tenant
|
||||
tenant_was_created.send(tenant)
|
||||
else:
|
||||
# SELF_HOSTED just have one tenant
|
||||
tenant = Tenant.query.first()
|
||||
TenantService.create_tenant_member(tenant, account, role="user")
|
||||
account.current_tenant = tenant
|
||||
if not dify_config.ALLOW_CREATE_WORKSPACE:
|
||||
raise WorkSpaceNotAllowedCreateError()
|
||||
tenant = TenantService.create_tenant(f"{account.name}'s Workspace")
|
||||
TenantService.create_tenant_member(tenant, account, role="owner")
|
||||
account.current_tenant = tenant
|
||||
tenant_was_created.send(tenant)
|
||||
|
||||
db.session.commit()
|
||||
except WorkSpaceNotAllowedCreateError:
|
||||
|
|
Loading…
Reference in New Issue
Block a user