fix document rename issue
This commit is contained in:
parent
72e25ecfef
commit
4c61c88e32
@ -1,3 +1,4 @@
|
|||||||
|
import copy
|
||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
@ -767,10 +768,11 @@ class DocumentService:
|
|||||||
|
|
||||||
if dataset.built_in_field_enabled:
|
if dataset.built_in_field_enabled:
|
||||||
if document.doc_metadata:
|
if document.doc_metadata:
|
||||||
document.doc_metadata[BuiltInField.document_name] = name
|
doc_metadata = copy.deepcopy(document.doc_metadata)
|
||||||
else:
|
doc_metadata[BuiltInField.document_name.value] = name
|
||||||
document.name = name
|
document.doc_metadata = doc_metadata
|
||||||
|
|
||||||
|
document.name = name
|
||||||
db.session.add(document)
|
db.session.add(document)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user