Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: handle AttributeError for datasets and index (#1052)
yezhwi8b8e510bfe7d
diff --git a/api/controllers/console/datasets/datasets_document.py b/api/controllers/console/datasets/datasets_document.pyindex 89d8cd6a6f5..9b212f2e90c 100644--- a/api/controllers/console/datasets/datasets_document.py+++ b/api/controllers/console/datasets/datasets_document.py@@ -138,6 +138,10 @@ class GetProcessRuleApi(Resource):req_data = request.argsdocument_id = req_data.get('document_id')++ # get default rules+ mode = DocumentService.DEFAULT_RULES['mode']+ rules = DocumentService.DEFAULT_RULES['rules']if document_id:# get the latest process ruledocument = Document.query.get_or_404(document_id)@@ -158,11 +162,9 @@ class GetProcessRuleApi(Resource):order_by(DatasetProcessRule.created_at.desc()). \limit(1). \one_or_none()- mode = dataset_process_rule.mode- rules = dataset_process_rule.rules_dict- else:- mode = DocumentService.DEFAULT_RULES['mode']- rules = DocumentService.DEFAULT_RULES['rules']+ if dataset_process_rule:+ mode = dataset_process_rule.mode+ rules = dataset_process_rule.rules_dictreturn {'mode': mode,diff --git a/api/core/indexing_runner.py b/api/core/indexing_runner.pyindex ea4ce31db0c..dcadd3f5ab5 100644--- a/api/core/indexing_runner.py+++ b/api/core/indexing_runner.py@@ -406,7 +406,8 @@ class IndexingRunner:filter(UploadFile.id == data_source_info['upload_file_id']). \one_or_none()- text_docs = FileExtractor.load(file_detail)+ if file_detail:+ text_docs = FileExtractor.load(file_detail)elif dataset_document.data_source_type == 'notion_import':loader = NotionLoader.from_document(dataset_document)text_docs = loader.load()