Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
a7305d14
Commit
a7305d14
authored
4 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Jobs: Dávka se stahuje s Content-Disposition: attachment a jménem
parent
17691b80
No related branches found
No related tags found
1 merge request
!9
WIP: Zárodek uživatelské části webu a submitování
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mo/web/util.py
+4
-1
4 additions, 1 deletion
mo/web/util.py
with
4 additions
and
1 deletion
mo/web/util.py
+
4
−
1
View file @
a7305d14
...
@@ -85,7 +85,10 @@ def send_job_result(job: db.Job) -> Response:
...
@@ -85,7 +85,10 @@ def send_job_result(job: db.Job) -> Response:
type
=
'
application/binary
'
type
=
'
application/binary
'
if
os
.
path
.
isfile
(
file
):
if
os
.
path
.
isfile
(
file
):
return
send_file
(
file
,
mimetype
=
type
)
return
send_file
(
file
,
mimetype
=
type
,
as_attachment
=
True
,
attachment_filename
=
job
.
out_file
)
else
:
else
:
logger
.
error
(
f
'
Soubor
{
file
}
je výsledkem jobu, ale ve FS neexistuje
'
)
logger
.
error
(
f
'
Soubor
{
file
}
je výsledkem jobu, ale ve FS neexistuje
'
)
raise
werkzeug
.
exceptions
.
NotFound
()
raise
werkzeug
.
exceptions
.
NotFound
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment