chore: add allow_download flag to document metadata
parent
796001a4ae
commit
f9f96fd2cd
|
|
@ -866,7 +866,7 @@ class DocumentSerializers(serializers.Serializer):
|
||||||
def get_document_paragraph_model(knowledge_id, instance: Dict):
|
def get_document_paragraph_model(knowledge_id, instance: Dict):
|
||||||
source_meta = {'source_file_id': instance.get('source_file_id')} if instance.get('source_file_id') else {}
|
source_meta = {'source_file_id': instance.get('source_file_id')} if instance.get('source_file_id') else {}
|
||||||
meta = {**instance.get('meta'), **source_meta} if instance.get('meta') is not None else source_meta
|
meta = {**instance.get('meta'), **source_meta} if instance.get('meta') is not None else source_meta
|
||||||
meta = convert_uuid_to_str(meta)
|
meta = {**convert_uuid_to_str(meta), 'allow_download': True}
|
||||||
|
|
||||||
document_model = Document(
|
document_model = Document(
|
||||||
**{
|
**{
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ def get_sync_web_document_handler(knowledge_id):
|
||||||
else:
|
else:
|
||||||
Document(name=source_url[0:128],
|
Document(name=source_url[0:128],
|
||||||
knowledge_id=knowledge_id,
|
knowledge_id=knowledge_id,
|
||||||
meta={'source_url': source_url, 'selector': selector},
|
meta={'source_url': source_url, 'selector': selector, 'allow_download': True},
|
||||||
type=KnowledgeType.WEB,
|
type=KnowledgeType.WEB,
|
||||||
char_length=0,
|
char_length=0,
|
||||||
status=State.FAILURE).save()
|
status=State.FAILURE).save()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue