Skip to content

Commit 9c7eb22

Browse files
committed
refactor: improve error message for non-existent files in document handling
--bug=1057925 --user=刘瑞斌 【知识库】知识库快速创建空白文档-添加段落和内容-随后下载源文档-下载文件提示异常 https://www.tapd.cn/62980211/s/1723202
1 parent cb28cfd commit 9c7eb22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/knowledge/serializers/document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ def download_source_file(self):
563563
self.is_valid(raise_exception=True)
564564
file = QuerySet(File).filter(source_id=self.data.get('document_id')).first()
565565
if not file:
566-
raise AppApiException(500, _('file not exist'))
566+
raise AppApiException(500, _('File not exist. Only manually uploaded documents are supported.'))
567567
return FileSerializer.Operate(data={'id': file.id}).get(with_valid=True)
568568

569569
def one(self, with_valid=False):

0 commit comments

Comments
 (0)