mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 03:36:36 +08:00
fix: fix failed test (#33241)
This commit is contained in:
parent
5a5238062a
commit
27f9cdedad
@ -74,7 +74,8 @@ class ExtractProcessor:
|
|||||||
else:
|
else:
|
||||||
suffix = ""
|
suffix = ""
|
||||||
# https://stackoverflow.com/questions/26541416/generate-temporary-file-names-without-creating-actual-file-in-python#comment90414256_26541521
|
# 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)
|
Path(file_path).write_bytes(response.content)
|
||||||
extract_setting = ExtractSetting(datasource_type=DatasourceType.FILE, document_model="text_model")
|
extract_setting = ExtractSetting(datasource_type=DatasourceType.FILE, document_model="text_model")
|
||||||
if return_text:
|
if return_text:
|
||||||
|
|||||||
@ -245,5 +245,6 @@ class EmailDeliveryTestHandler:
|
|||||||
)
|
)
|
||||||
if token:
|
if token:
|
||||||
substitutions["form_token"] = 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
|
return substitutions
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user