Commit 48984437 authored by Mikaël Salson's avatar Mikaël Salson Committed by Mathieu Giraud
Browse files

results_file/delete: sample set ID is now provided in parameter

It avoids ambiguity and ensures that we redirect to the right page.
parent 5a1014b6
......@@ -87,11 +87,8 @@ def info():
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
def confirm():
patient_id = db((db.sequence_file.id == db.results_file.sequence_file_id)
&(db.results_file.id == request.vars["results_file_id"])
&(db.sample_set_membership.sequence_file_id == db.sequence_file.id)
&(db.patient.sample_set_id == db.sample_set_membership.sample_set_id)
).select(db.patient.id).first().id
sample_set_id = request.vars['sample_set_id']
if (auth.can_modify_sample_set(sample_set_id)
& auth.can_process_sample_set(sample_set_id)):
return dict(message=T('result confirm'))
......@@ -101,10 +98,7 @@ def confirm():
#
def delete():
sample_set_id = db((db.sequence_file.id == db.results_file.sequence_file_id)
&(db.results_file.id == request.vars["results_file_id"])
&(db.sample_set_membership.sequence_file_id == db.sequence_file.id)
).select(db.sample_set_membership.sample_set_id).first().sample_set_id
sample_set_id = request.vars['sample_set_id']
if (auth.can_modify_sample_set(sample_set_id)
& auth.can_process_sample_set(sample_set_id)):
......
......@@ -9,7 +9,7 @@
Are you sure you want to delete the results of this processing?</br>
<div class="center">
<button onclick="db.call('results_file/delete', {'results_file_id' :'{{=request.vars["results_file_id"]}}'} )">delete</button>
<button onclick="db.call('results_file/delete', {'results_file_id' :'{{=request.vars["results_file_id"]}}', 'sample_set_id': '{{=request.vars["sample_set_id"]}}'} )">delete</button>
<button onclick="db.back();">cancel</button>
</div>
</div>
......
......@@ -121,7 +121,7 @@
{{pass}}
</td>
{{if can_modify and auth.can_process_sample_set(request.vars['id']):}}
<td class="pointer" onclick="db.call('results_file/confirm', {'results_file_id' :'{{=row.results_file.id}}'})" > <i class="icon-erase" title="delete process"></i> </td>
<td class="pointer" onclick="db.call('results_file/confirm', {'results_file_id' :'{{=row.results_file.id}}', 'sample_set_id': '{{=request.vars["id"]}}'})" > <i class="icon-erase" title="delete process"></i> </td>
{{else:}}
<td></td>
{{pass}}
......
Markdown is supported
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