|
|
|
|
@ -29,6 +29,7 @@ from models.account import (
|
|
|
|
|
Tenant,
|
|
|
|
|
TenantAccountJoin,
|
|
|
|
|
TenantAccountRole,
|
|
|
|
|
TenantPluginAutoUpgradeStrategy,
|
|
|
|
|
TenantStatus,
|
|
|
|
|
)
|
|
|
|
|
from models.model import DifySetup
|
|
|
|
|
@ -828,6 +829,17 @@ class TenantService:
|
|
|
|
|
db.session.add(tenant)
|
|
|
|
|
db.session.commit()
|
|
|
|
|
|
|
|
|
|
plugin_upgrade_strategy = TenantPluginAutoUpgradeStrategy(
|
|
|
|
|
tenant_id=tenant.id,
|
|
|
|
|
strategy_setting=TenantPluginAutoUpgradeStrategy.StrategySetting.FIX_ONLY,
|
|
|
|
|
upgrade_time_of_day=0,
|
|
|
|
|
upgrade_mode=TenantPluginAutoUpgradeStrategy.UpgradeMode.EXCLUDE,
|
|
|
|
|
exclude_plugins=[],
|
|
|
|
|
include_plugins=[],
|
|
|
|
|
)
|
|
|
|
|
db.session.add(plugin_upgrade_strategy)
|
|
|
|
|
db.session.commit()
|
|
|
|
|
|
|
|
|
|
tenant.encrypt_public_key = generate_key_pair(tenant.id)
|
|
|
|
|
db.session.commit()
|
|
|
|
|
return tenant
|
|
|
|
|
|