Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 54478fa9 authored by Mikaël Salson's avatar Mikaël Salson

server/sample: Add the sample type to the sample edit form.

This allows to know where we come from and therefore where we must redirect to.
parent 54d36dd1
......@@ -250,7 +250,8 @@ def edit():
patient = patient,
pre_process_list = pre_process_list,
run = run,
file = db.sequence_file[request.vars["id"]])
file = db.sequence_file[request.vars["id"]],
sample_type = request.vars['sample_type'])
else:
return error_message("you need admin permission to edit files")
......@@ -261,7 +262,7 @@ def edit_form():
error = ""
patient_id = None
run_id = None
if request.vars['patient_id'] != '' :
patient_id = int(request.vars['patient_id'].split('(')[-1][:-1])
if request.vars['run_id'] != '' :
......@@ -301,15 +302,17 @@ def edit_form():
run_sample_set_id = db.run[run_id].sample_set_id
id_sample_set_membership_run = db.sample_set_membership.insert(sample_set_id=run_sample_set_id,
sequence_file_id=request.vars["id"])
redirect_args = {"id" : run_sample_set_id}
#add sequence_file to a patient sample_set
if patient_id is not None :
patient_sample_set_id = db.patient[patient_id].sample_set_id
id_sample_set_membership_patient = db.sample_set_membership.insert(sample_set_id=patient_sample_set_id,
sequence_file_id=request.vars["id"])
redirect_args = {"id" : patient_sample_set_id}
originating_id = patient_sample_set_id
if request.vars['sample_type'] == 'run':
originating_id = run_sample_set_id
redirect_args = {"id" : originating_id}
res = {"file_id" : request.vars["id"],
"message": "file {%s}: metadata saved" % request.vars["id"],
......
......@@ -161,6 +161,7 @@ def index():
analysis_count=analysis_count,
analysis_file = analysis_file,
analysis_filename = analysis_filename,
sample_type = db.sample_set[request.vars["id"]].sample_type,
config=config)
"""
......
......@@ -10,6 +10,7 @@ info = db.sequence_file[request.vars["id"]]
<form id="upload_form" action="DB_ADDRESS/file/edit_form" enctype="multipart/form-data" method="post">
<input type="hidden" id="filename" name="filename" type="text" value="">
<input type="hidden" id="file_id" name="id" value="{{=request.vars["id"]}}" >
<input type="hidden" id="sample_type" name="sample_type" value="{{=sample_type}}" />
<table>
<tbody>
<tr class='db_table_split' ><td colspan="2"> sequence file(s) </td></tr>
......
......@@ -95,7 +95,7 @@
{{pass}}
{{if can_modify:}}
<td class="pointer" onclick="db.call('file/edit', {'id' :'{{=row.sequence_file.id}}'} )" > <i class="icon-pencil-2" title="edit sample information"></i> </td>
<td class="pointer" onclick="db.call('file/edit', {'id' :'{{=row.sequence_file.id}}', 'sample_type': '{{=sample_type}}'} )" > <i class="icon-pencil-2" title="edit sample information"></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