mirror of
https://github.com/langgenius/dify.git
synced 2026-03-12 18:48:53 +08:00
fix: fix failed test (#33241)
This commit is contained in:
@ -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:
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user