Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Fix: ensure InstalledApp deletion uses model instances instead of Row (#24942)

Yongtao Huang067b0d07c4d1
diff --git a/api/controllers/console/admin.py b/api/controllers/console/admin.py
index 7e5c28200aa..cae2d7cbe32 100644
--- a/api/controllers/console/admin.py
+++ b/api/controllers/console/admin.py
@@ -130,15 +130,19 @@ class InsertExploreAppApi(Resource):
app.is_public = False
with Session(db.engine) as session:
- installed_apps = session.execute(
- select(InstalledApp).where(
- InstalledApp.app_id == recommended_app.app_id,
- InstalledApp.tenant_id != InstalledApp.app_owner_tenant_id,
+ installed_apps = (
+ session.execute(
+ select(InstalledApp).where(
+ InstalledApp.app_id == recommended_app.app_id,
+ InstalledApp.tenant_id != InstalledApp.app_owner_tenant_id,
+ )
)
- ).all()
+ .scalars()
+ .all()
+ )
- for installed_app in installed_apps:
- db.session.delete(installed_app)
+ for installed_app in installed_apps:
+ session.delete(installed_app)
db.session.delete(recommended_app)
db.session.commit()
diff --git a/web/app/components/tools/setting/build-in/config-credentials.tsx b/web/app/components/tools/setting/build-in/config-credentials.tsx
index 3ce3f62639c..f6b9c05c44f 100644
--- a/web/app/components/tools/setting/build-in/config-credentials.tsx
+++ b/web/app/components/tools/setting/build-in/config-credentials.tsx
@@ -111,7 +111,7 @@ const ConfigCredential: FC<Props> = ({
<Button onClick={onRemove}>{t('common.operation.remove')}</Button>
)
}
- < div className='flex space-x-2'>
+ <div className='flex space-x-2'>
<Button onClick={onCancel}>{t('common.operation.cancel')}</Button>
<Button loading={isLoading || isSaving} disabled={isLoading || isSaving} variant='primary' onClick={handleSave}>{t('common.operation.save')}</Button>
</div>