Skip to content
Snippets Groups Projects
Verified Commit 511760f5 authored by Peter Stanko's avatar Peter Stanko
Browse files

Fixed path

parent cebe0aa4
No related branches found
No related tags found
1 merge request!12Codename
Pipeline #
...@@ -152,11 +152,13 @@ def send_zip(storage_submission: entities.Submission): ...@@ -152,11 +152,13 @@ def send_zip(storage_submission: entities.Submission):
def send_selected_file(storage_submission: entities.Submission, path_query: str): def send_selected_file(storage_submission: entities.Submission, path_query: str):
path = storage_submission.path / Path(path_query) path_query = Path(path_query)
path = (storage_submission.path / path_query)
path = path.absolute()
if not path.exists(): if not path.exists():
raise errors.PortalAPIError(400, f"Requested path does not exist: {path}") raise errors.PortalAPIError(400, f"Requested path does not exist: {path}")
log.debug(f"[SEND] Sending file for submission ({storage_submission.entity_id}): {path}") log.debug(f"[SEND] Sending file for submission ({storage_submission.entity_id}): {path}")
return flask.send_file(str(path)) return flask.send_file(str(path), attachment_filename=path.name)
def send_file_or_zip(storage_entity): def send_file_or_zip(storage_entity):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment