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
|
email=email, name=name, interface_language=interface_language, password=password
|
||||||
)
|
)
|
||||||
|
|
||||||
# SELF_HOSTED Just create account, not create tenant
|
TenantService.create_owner_tenant_if_not_exist(account=account)
|
||||||
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()
|
|
||||||
|
|
||||||
return account
|
return account
|
||||||
|
|
||||||
|
@ -684,18 +676,12 @@ class RegisterService:
|
||||||
if open_id is not None or provider is not None:
|
if open_id is not None or provider is not None:
|
||||||
AccountService.link_account_integrate(provider, open_id, account)
|
AccountService.link_account_integrate(provider, open_id, account)
|
||||||
|
|
||||||
if dify_config.EDITION != "SELF_HOSTED":
|
if not dify_config.ALLOW_CREATE_WORKSPACE:
|
||||||
if not dify_config.ALLOW_CREATE_WORKSPACE:
|
raise WorkSpaceNotAllowedCreateError()
|
||||||
raise WorkSpaceNotAllowedCreateError()
|
tenant = TenantService.create_tenant(f"{account.name}'s Workspace")
|
||||||
tenant = TenantService.create_tenant(f"{account.name}'s Workspace")
|
TenantService.create_tenant_member(tenant, account, role="owner")
|
||||||
TenantService.create_tenant_member(tenant, account, role="owner")
|
account.current_tenant = tenant
|
||||||
account.current_tenant = tenant
|
tenant_was_created.send(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
|
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
except WorkSpaceNotAllowedCreateError:
|
except WorkSpaceNotAllowedCreateError:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user