Skip to content

Commit f668daa

Browse files
committed
fix: refactor delete method in DocumentSerializers for improved clarity
--bug=1060005 --user=刘瑞斌 【资源管理】知识库-删除文档报错 https://www.tapd.cn/62980211/s/1749123
1 parent 9a626ef commit f668daa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

apps/knowledge/serializers/document.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ def cancel(self, instance, with_valid=True):
662662

663663
@transaction.atomic
664664
def delete(self):
665+
self.is_valid(raise_exception=True)
665666
document_id = self.data.get("document_id")
666667
source_file_ids = [
667668
doc['meta'].get(

0 commit comments

Comments
 (0)