fix: fix failed test (#33241)

This commit is contained in:
wangxiaolei
2026-03-11 09:37:19 +08:00
committed by GitHub
parent 5a5238062a
commit 27f9cdedad
2 changed files with 4 additions and 2 deletions

View File

@ -74,7 +74,8 @@ class ExtractProcessor:
else:
suffix = ""
# https://stackoverflow.com/questions/26541416/generate-temporary-file-names-without-creating-actual-file-in-python#comment90414256_26541521
file_path = f"{temp_dir}/{tempfile.gettempdir()}{suffix}"
# Generate a temporary filename under the created temp_dir and ensure the directory exists
file_path = f"{temp_dir}/{next(tempfile._get_candidate_names())}{suffix}" # type: ignore
Path(file_path).write_bytes(response.content)
extract_setting = ExtractSetting(datasource_type=DatasourceType.FILE, document_model="text_model")
if return_text:

View File

@ -245,5 +245,6 @@ class EmailDeliveryTestHandler:
)
if token:
substitutions["form_token"] = token
substitutions["form_link"] = _build_form_link(token) or ""
link = _build_form_link(token)
substitutions["form_link"] = link if link is not None else f"/form/{token}"
return substitutions