Merge branch 'main' into deploy/dev
Some checks are pending
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Waiting to run
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Blocked by required conditions
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Blocked by required conditions

This commit is contained in:
-LAN- 2024-11-01 19:24:17 +08:00
commit 98cc2272a9
2 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,6 @@
import json
from collections.abc import Mapping, Sequence
from datetime import datetime
from datetime import datetime, timezone
from enum import Enum
from typing import Any, Optional, Union
@ -107,7 +107,9 @@ class Workflow(db.Model):
db.DateTime, nullable=False, server_default=db.text("CURRENT_TIMESTAMP(0)")
)
updated_by: Mapped[Optional[str]] = mapped_column(StringUUID)
updated_at: Mapped[datetime] = mapped_column(db.DateTime, nullable=False)
updated_at: Mapped[datetime] = mapped_column(
sa.DateTime, nullable=False, default=datetime.now(tz=timezone.utc), server_onupdate=func.current_timestamp()
)
_environment_variables: Mapped[str] = mapped_column(
"environment_variables", db.Text, nullable=False, server_default="{}"
)

View File

@ -986,9 +986,6 @@ class DocumentService:
raise NotFound("Document not found")
if document.display_status != "available":
raise ValueError("Document is not available")
# update document name
if document_data.get("name"):
document.name = document_data["name"]
# save process rule
if document_data.get("process_rule"):
process_rule = document_data["process_rule"]
@ -1065,6 +1062,10 @@ class DocumentService:
document.data_source_type = document_data["data_source"]["type"]
document.data_source_info = json.dumps(data_source_info)
document.name = file_name
# update document name
if document_data.get("name"):
document.name = document_data["name"]
# update document to be waiting
document.indexing_status = "waiting"
document.completed_at = None