Commit 425d70b8 authored by marc's avatar marc Committed by Mathieu Giraud

file.py : bug fix : deleting a sequence file will effectively delete the associated results files

parent afb89816
......@@ -440,7 +440,7 @@ def delete():
\param: id (the sequence ID)
\param: delete_results: (optional) boolean stating if we also want to delete the results.
'''
delete_results = ('delete_results' in request.vars and request.vars['delete_results'] == 'True')
delete_results = ('delete_results' in request.vars and request.vars['delete_results'] == "True")
sample_set = db.sample_set[request.vars["redirect_sample_set_id"]]
associated_id = None
if sample_set.sample_type != 'sequence_file':
......@@ -452,9 +452,9 @@ def delete():
if not(delete_results):
delete_sequence_file(request.vars['id'])
else:
db(db.sequence_file.id == request.vars["id"]).delete()
db(db.results_file.sequence_file_id == request.vars["id"]).delete()
db(db.sequence_file.id == request.vars["id"]).delete()
for row in db( db.sample_set_membership.sequence_file_id == request.vars["id"]).select() :
db(db.sample_set_membership.id == row.id).delete()
......
......@@ -35,9 +35,9 @@
{{if delete_results or delete_only_sequence:}}
<button onclick="db.call('file/delete', {'id' :'{{=request.vars["id"]}}', 'redirect_sample_set_id' :'{{=request.vars["redirect_sample_set_id"]}}', 'delete_results': '{{=delete_results}}'} )">delete</button>
{{else:}}
<button onclick="db.call('file/confirm', {'id': '{{=request.vars["id"]}}', 'redirect_sample_set_id' :'{{=request.vars["redirect_sample_set_id"]}}',
<button onclick="db.call('file/delete', {'id': '{{=request.vars["id"]}}', 'redirect_sample_set_id' :'{{=request.vars["redirect_sample_set_id"]}}',
'delete_results': 'False', 'delete_only_sequence': 'True'})">delete sequence alone</button>
<button onclick="db.call('file/confirm', {'id': '{{=request.vars["id"]}}', 'redirect_sample_set_id' :'{{=request.vars["redirect_sample_set_id"]}}',
<button onclick="db.call('file/delete', {'id': '{{=request.vars["id"]}}', 'redirect_sample_set_id' :'{{=request.vars["redirect_sample_set_id"]}}',
'delete_results': 'True', 'delete_only_sequence': 'False'})">delete sequence and results</button>
{{pass}}
<button onclick="db.call('sample_set/index', {'id' :'{{=request.vars["redirect_sample_set_id"]}}'} )">cancel</button>
......
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