Commit eeee0889 authored by Marc Duez's avatar Marc Duez Committed by Mathieu Giraud
Browse files

server: debug save_analysis

parent 63b4c232
......@@ -222,8 +222,8 @@ def save_analysis():
error += "you don't have permission to make change on this patient, "
if error == "" :
analysis_query = db( (db.analysis_file.patient_id == 1)
& (db.analysis_file.config_id == 1 ) )
analysis_query = db( (db.analysis_file.patient_id == request.vars['patient_id'])
& (db.analysis_file.config_id == request.vars['config_id'] ) )
f = request.vars['fileToUpload']
......
......@@ -76,9 +76,8 @@ def edit_form():
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
def upload():
import shutil, os.path, datetime
session.forget(response)
error = ""
if request.vars['id'] == None :
error += "missing id"
......@@ -86,10 +85,9 @@ def upload():
mes = "file " + request.vars['id'] + " : "
if request.vars.file != None :
db.sequence_file[request.vars["id"]] = dict(data_file = request.vars.file )
f = request.vars.file
db.sequence_file[request.vars["id"]] = dict(data_file = db.sequence_file.data_file.store(f.file, f.filename))
mes += "file saved, "
patient_id = db.sequence_file[request.vars["id"]].patient_id
res = {"message": mes}
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
......
......@@ -5,8 +5,6 @@ if request.env.http_origin:
response.headers['Access-Control-Allow-Credentials'] = 'true'
response.headers['Access-Control-Max-Age'] = 86400
## return patient file list
##
def info():
......
......@@ -80,7 +80,6 @@ use_janrain(auth, filename='private/janrain.key')
#########################################################################
db.define_table('patient',
Field('first_name','string'),
Field('last_name','string'),
......
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