Commit 6b147952 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

Merge branch 'feature-sc/5108-bug-in-download-of-results-artifact-files' into 'dev'

Resolve "Bug in download of results artifact files"

Closes #5108

See merge request !1278
parents 35e2421c e2f9bc80
Pipeline #738707 failed with stages
in 46 minutes and 50 seconds
......@@ -139,7 +139,7 @@ Database.prototype = {
function(a) {
// Link to result file and launch download
var file_name = "reads__"+clone_id+"__file_id_"+"_"+sequence_file_id+".fa"
var path_data = DB_ADDRESS+"/results_file/download?results_file_id="+a.result_id+"&filename="+file_name
var path_data = DB_ADDRESS+"/default/download/"+a.data_file+"?filename="+file_name
var anchor = document.createElement('a');
anchor.setAttribute("download", file_name);
anchor.setAttribute("href", path_data);
......
......@@ -234,7 +234,8 @@ def checkProcess():
res = {"success" : "true",
"status" : task.status,
"data" : {'run_result': run.run_result,
'result_id': results_file.id
'result_id': results_file.id,
'data_file': results_file.data_file
},
"processId" : task.id}
else :
......
......@@ -120,15 +120,8 @@ def download():
if auth.can_view_sample_set(sample_set_id) and not '..' in request.vars['filename']:
try:
results_id = int(request.vars["results_file_id"])
query = db( (db.results_file.id == request.vars["results_file_id"]) ).select(db.results_file.id, db.results_file.hidden, db.results_file.data_file)
if query[0].hidden == True:
# If hidden, only result file is important (getReads)
filepath = defs.DIR_RESULTS + query[0].data_file
else: # else download given file
olddir = defs.DIR_OUT_VIDJIL_ID % results_id
filepath = olddir + request.vars['filename']
directory = defs.DIR_OUT_VIDJIL_ID % results_id
filepath = directory + request.vars['filename']
log.info("Downloaded results file", extra={'user_id': auth.user.id,
'record_id': request.vars["results_file_id"],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment