Skip to content

Commit

Permalink
[fix] fix the bug that modify document name not effective (#10154)
Browse files Browse the repository at this point in the history
  • Loading branch information
ProseGuys authored and Yeuoly committed Nov 5, 2024
1 parent 0d5c0b4 commit ac1f93e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/services/dataset_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -986,9 +986,6 @@ def update_document_with_dataset_id(
raise NotFound("Document not found")
if document.display_status != "available":
raise ValueError("Document is not available")
# update document name
if document_data.get("name"):
document.name = document_data["name"]
# save process rule
if document_data.get("process_rule"):
process_rule = document_data["process_rule"]
Expand Down Expand Up @@ -1065,6 +1062,10 @@ def update_document_with_dataset_id(
document.data_source_type = document_data["data_source"]["type"]
document.data_source_info = json.dumps(data_source_info)
document.name = file_name

# update document name
if document_data.get("name"):
document.name = document_data["name"]
# update document to be waiting
document.indexing_status = "waiting"
document.completed_at = None
Expand Down

0 comments on commit ac1f93e

Please sign in to comment.