attachment_filename -> download_name

This commit is contained in:
Kikimanox
2022-08-29 23:31:59 +02:00
parent 77c5473142
commit 246c60de02
2 changed files with 6 additions and 4 deletions
+3 -3
View File
@@ -132,7 +132,7 @@ def get_conllu(file_id): # noqa: E501
:rtype: str
"""
try:
return send_file(util.get_conllu_file_path_by_id(file_id), attachment_filename=f'{file_id}.conllu')
return send_file(util.get_conllu_file_path_by_id(file_id), download_name=f'{file_id}.conllu')
except FileNotFoundError as e:
return "The conllu with this ID doesn't exist.", 404
@@ -148,7 +148,7 @@ def get_file(file_id): # noqa: E501
:rtype: List[bytearray]
"""
try:
return send_file(util.get_original_file_path_by_id(file_id), attachment_filename=f'{file_id}.xml')
return send_file(util.get_original_file_path_by_id(file_id), download_name=f'{file_id}.xml')
except FileNotFoundError as e:
return "The file with this ID doesn't exist.", 404
@@ -164,6 +164,6 @@ def oss_besedilo_po_id_get(file_id): # noqa: E501
:rtype: str
"""
try:
return send_file(util.get_original_file_path_by_id(file_id), attachment_filename=f'{file_id}.xml')
return send_file(util.get_original_file_path_by_id(file_id), download_name=f'{file_id}.xml')
except FileNotFoundError as e:
return "The file with this ID doesn't exist.", 404