Skip to content

Commit f9f96fd

Browse files
committed
chore: add allow_download flag to document metadata
1 parent 796001a commit f9f96fd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/knowledge/serializers/document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ def get_paragraph_model(document_model, paragraph_list: List):
866866
def get_document_paragraph_model(knowledge_id, instance: Dict):
867867
source_meta = {'source_file_id': instance.get('source_file_id')} if instance.get('source_file_id') else {}
868868
meta = {**instance.get('meta'), **source_meta} if instance.get('meta') is not None else source_meta
869-
meta = convert_uuid_to_str(meta)
869+
meta = {**convert_uuid_to_str(meta), 'allow_download': True}
870870

871871
document_model = Document(
872872
**{

apps/knowledge/task/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def handler(source_url: str, selector, response: Fork.Response):
8686
else:
8787
Document(name=source_url[0:128],
8888
knowledge_id=knowledge_id,
89-
meta={'source_url': source_url, 'selector': selector},
89+
meta={'source_url': source_url, 'selector': selector, 'allow_download': True},
9090
type=KnowledgeType.WEB,
9191
char_length=0,
9292
status=State.FAILURE).save()

0 commit comments

Comments
 (0)