Commit 3bee4487 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

Merge remote-tracking branch 'origin/rbx.vidjil.org'

parents c1cb28bd efd1322a
......@@ -51,7 +51,7 @@ def run_request():
id_patient = db.sequence_file[request.vars["sequence_file_id"]].patient_id
if not auth.has_permission('admin', 'patient', id_patient) :
error += "you don't have permission to run request for this patient ("+str(id_patient)+"), "
error += "you do not have permission to launch process for this patient ("+str(id_patient)+"), "
if error == "" :
res = schedule_run(request.vars["sequence_file_id"], request.vars["config_id"])
......@@ -81,7 +81,7 @@ def get_data():
error += "id config needed, "
if not auth.has_permission('admin', 'patient', request.vars["patient_id"]) and \
not auth.has_permission('read', 'patient', request.vars["patient_id"]):
error += "you don't have permission to consult this patient ("+id_patient+")"
error += "you do not have permission to consult this patient ("+id_patient+")"
query = db( ( db.fused_file.patient_id == request.vars["patient_id"] )
& ( db.fused_file.config_id == request.vars["config_id"] )
......@@ -131,7 +131,7 @@ def get_analysis():
error += "id config needed, "
if not auth.has_permission('admin', 'patient', request.vars["patient_id"]) and \
not auth.has_permission('read', 'patient', request.vars["patient_id"]):
error += "you don't have permission to consult this patient ("+id_patient+")"
error += "you do not have permission to consult this patient ("+id_patient+")"
## empty analysis file
res = {"samples": {"number": 0,
......@@ -188,7 +188,7 @@ def save_analysis():
if not "config_id" in request.vars:
error += "id config needed, "
if not auth.has_permission('admin', 'patient', request.vars['patient_id']) :
error += "you don't have permission to make change on this patient, "
error += "you do not have permission to save changes on this patient"
if error == "" :
analysis_query = db( (db.analysis_file.patient_id == request.vars['patient_id'])
......
......@@ -217,7 +217,9 @@ def remove_permission():
auth.del_permission(request.vars["group_id"], 'admin', db.patient, request.vars["patient_id"])
auth.del_permission(request.vars["group_id"], 'read', db.patient, request.vars["patient_id"])
res = {"redirect" : "patient/permission" , "args" : { "id" : request.vars["patient_id"]} }
res = {"redirect" : "patient/permission" ,
"args" : { "id" : request.vars["patient_id"]},
"message" : "access removed to '%s'" % request.vars["group_id"]}
log.info(res)
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
else :
......@@ -232,7 +234,9 @@ def change_permission():
if (auth.has_permission('admin', 'patient', request.vars["patient_id"]) ):
auth.add_permission(request.vars["group_id"], request.vars["permission"], db.patient, request.vars["patient_id"])
res = {"redirect" : "patient/permission" , "args" : { "id" : request.vars["patient_id"]} }
res = {"redirect" : "patient/permission" ,
"args" : { "id" : request.vars["patient_id"]},
"message" : "access '%s' granted to '%s'" % (request.vars["permission"], request.vars["group_id"])}
log.info(res)
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
else :
......
......@@ -224,7 +224,10 @@ class MsgUserAdapter(logging.LoggerAdapter):
def process(self, msg, kwargs):
if type(msg) is dict:
msg = msg['message']
if 'message' in msg:
msg = msg['message']
else:
msg = '?'
ip = request.client
if ip in ips:
ip = "%s/%s" % (ip, ips[ip])
......
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