Skip to content

Commit

Permalink
fix: fix update external dataset error in dataset list (#11989)
Browse files Browse the repository at this point in the history
  • Loading branch information
VoidIsVoid authored Dec 23, 2024
1 parent 74b1b60 commit 02a7ae1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/services/dataset_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,15 @@ def update_dataset(dataset_id, data, user):

DatasetService.check_dataset_permission(dataset, user)
if dataset.provider == "external":
dataset.retrieval_model = data.get("external_retrieval_model", None)
external_retrieval_model = data.get("external_retrieval_model", None)
if external_retrieval_model:
dataset.retrieval_model = external_retrieval_model
dataset.name = data.get("name", dataset.name)
dataset.description = data.get("description", "")
permission = data.get("permission")
if permission:
dataset.permission = permission
external_knowledge_id = data.get("external_knowledge_id", None)
dataset.permission = data.get("permission")
db.session.add(dataset)
if not external_knowledge_id:
raise ValueError("External knowledge id is required.")
Expand Down

0 comments on commit 02a7ae1

Please sign in to comment.