Commit e2f9bc80 authored by Thonier Florian's avatar Thonier Florian
Browse files

server; fix error of results download path

Their are 2 function to download results files. One for true results file, in results directory, set by 'default' controller.
Another is set by result_file controller, and allow to download results file from tmp analysis directory

now get reads will download data with first controller (default).
parent 3a132b6d
Pipeline #734157 passed with stages
in 130 minutes and 37 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