Commit cb9d6dd6 authored by HERBERT Ryan's avatar HERBERT Ryan Committed by Vidjil Team

controllers/file.py Added route to update info

 This route is designed to be used asynchronously by the browser to
 update a timepoint's info
parent f07e5c53
...@@ -277,3 +277,22 @@ def producer_list(): ...@@ -277,3 +277,22 @@ def producer_list():
res = {"producer": producer_list} res = {"producer": producer_list}
return gluon.contrib.simplejson.dumps(res, separators=(',',':')) return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
def save_info():
sequence_file_id = request.vars["id"]
row = db.sequence_file[sequence_file_id]
if row is not None:
if auth.can_modify_patient(row.patient_id):
row = dict(info = request.vars["info"])
res = {"success": True,
"message": "The changes have been saved"}
else:
res = {"success": False,
"message": "You do not have permission to do that"}
else:
res = {"success": False,
"message": "An error occured"}
return gluon.contrib.simplejson.dumps(res, separators=(',', ':'))
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