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: provider model not delete when reset key pair (#946)

takatosta3aba7a9aae7
diff --git a/api/commands.py b/api/commands.py
index a86e61e059a..a4b9d258d1a 100644
--- a/api/commands.py
+++ b/api/commands.py
@@ -20,7 +20,7 @@ from models.model import Account
import secrets
import base64
-from models.provider import Provider, ProviderType, ProviderQuotaType
+from models.provider import Provider, ProviderType, ProviderQuotaType, ProviderModel
@click.command('reset-password', help='Reset the account password.')
@@ -102,6 +102,7 @@ def reset_encrypt_key_pair():
tenant.encrypt_public_key = generate_key_pair(tenant.id)
db.session.query(Provider).filter(Provider.provider_type == 'custom').delete()
+ db.session.query(ProviderModel).delete()
db.session.commit()
click.echo(click.style('Congratulations! '