|
|
|
|
|
|
|
|
from models.account import Account |
|
|
from models.account import Account |
|
|
from models.model import App, AppMode, AppModelConfig, Site |
|
|
from models.model import App, AppMode, AppModelConfig, Site |
|
|
from models.tools import ApiToolProvider |
|
|
from models.tools import ApiToolProvider |
|
|
|
|
|
from services.billing_service import BillingService |
|
|
from services.enterprise.enterprise_service import EnterpriseService |
|
|
from services.enterprise.enterprise_service import EnterpriseService |
|
|
from services.feature_service import FeatureService |
|
|
from services.feature_service import FeatureService |
|
|
from services.tag_service import TagService |
|
|
from services.tag_service import TagService |
|
|
|
|
|
|
|
|
# update web app setting as private |
|
|
# update web app setting as private |
|
|
EnterpriseService.WebAppAuth.update_app_access_mode(app.id, "private") |
|
|
EnterpriseService.WebAppAuth.update_app_access_mode(app.id, "private") |
|
|
|
|
|
|
|
|
|
|
|
if dify_config.BILLING_ENABLED: |
|
|
|
|
|
BillingService.clean_billing_info_cache(app.tenant_id) |
|
|
|
|
|
|
|
|
return app |
|
|
return app |
|
|
|
|
|
|
|
|
def get_app(self, app: App) -> App: |
|
|
def get_app(self, app: App) -> App: |
|
|
|
|
|
|
|
|
if FeatureService.get_system_features().webapp_auth.enabled: |
|
|
if FeatureService.get_system_features().webapp_auth.enabled: |
|
|
EnterpriseService.WebAppAuth.cleanup_webapp(app.id) |
|
|
EnterpriseService.WebAppAuth.cleanup_webapp(app.id) |
|
|
|
|
|
|
|
|
|
|
|
if dify_config.BILLING_ENABLED: |
|
|
|
|
|
BillingService.clean_billing_info_cache(app.tenant_id) |
|
|
|
|
|
|
|
|
# Trigger asynchronous deletion of app and related data |
|
|
# Trigger asynchronous deletion of app and related data |
|
|
remove_app_and_related_data_task.delay(tenant_id=app.tenant_id, app_id=app.id) |
|
|
remove_app_and_related_data_task.delay(tenant_id=app.tenant_id, app_id=app.id) |
|
|
|
|
|
|