Commit 0680a0f9 authored by Ryan Herbert's avatar Ryan Herbert
Browse files

sample_set controllers register tags for info field

parent 114bad36
# coding: utf8
import gluon.contrib.simplejson, datetime
import vidjil_utils
from tag import *
import time
import datetime
......@@ -164,6 +165,7 @@ def add_form():
id_label=request.vars["id_label"],
creator=auth.user_id)
register_tags(db, defs.SET_TYPE_PATIENT, id, request.vars["info"])
user_group = int(request.vars["patient_group"])
admin_group = db(db.auth_group.role=='admin').select().first().id
......@@ -229,6 +231,7 @@ def edit_form():
error += "patient id needed, "
if error=="" :
patient = db.patient[request.vars["id"]]
db.patient[request.vars["id"]] = dict(first_name=request.vars["first_name"],
last_name=request.vars["last_name"],
birth=request.vars["birth"],
......@@ -236,6 +239,9 @@ def edit_form():
id_label=request.vars["id_label"]
)
if (patient.info != request.vars["info"]):
register_tags(db, defs.SET_TYPE_PATIENT, request.vars["id"], request.vars["info"], reset=True)
res = {"redirect": "back",
"message": "%s %s (%s): patient edited" % (request.vars["first_name"], request.vars["last_name"], request.vars["id"])}
log.info(res, extra={'user_id': auth.user.id, 'record_id': request.vars['id'], 'table_name': 'patient'})
......
# coding: utf8
import gluon.contrib.simplejson, datetime
import vidjil_utils
from tag import *
import time
if request.env.http_origin:
......@@ -70,6 +71,7 @@ def add_form():
pcr=request.vars["pcr"],
creator=auth.user_id)
register_tags(db, defs.SET_TYPE_RUN, id, request.vars["info"])
user_group = int(request.vars["run_group"])
admin_group = db(db.auth_group.role=='admin').select().first().id
......@@ -145,6 +147,7 @@ def edit_form():
error += "patient id needed, "
if error=="" :
run = db.run[request.vars["id"]]
db.run[request.vars["id"]] = dict(name=request.vars["name"],
run_date=request.vars["run_date"],
info=request.vars["info"],
......@@ -153,6 +156,9 @@ def edit_form():
id_label=request.vars["id_label"]
)
if (run.info != request.vars["info"]):
register_tags(db, defs.SET_TYPE_RUN, request.vars["id"], request.vars["info"], reset=True)
res = {"redirect": "back",
"message": "%s (%s): run edited" % (request.vars["name"], request.vars["id"])}
log.info(res, extra={'user_id': auth.user.id, 'record_id': request.vars["id"], 'table_name': 'run'})
......
# coding: utf8
import gluon.contrib.simplejson, datetime
import vidjil_utils
from tag import *
import time
if request.env.http_origin:
......@@ -239,6 +240,7 @@ def add_form():
creator=auth.user_id,
sample_set_id=id_sample_set)
register_tags(db, defs.SET_TYPE_GENERIC, id, request.vars["info"])
user_group = int(request.vars["sample_set_group"])
admin_group = db(db.auth_group.role=='admin').select().first().id
......@@ -296,10 +298,14 @@ def edit_form():
error += "sample set id needed, "
if error=="" :
generic = db.generic[request.vars["id"]]
db.generic[request.vars["id"]] = dict(name=request.vars["name"],
info=request.vars["info"],
)
if (generic.info != request.vars["info"]):
register_tags(db, defs.SET_TYPE_GENERIC, request.vars["id"], request.vars["info"], reset=True)
res = {"redirect": "back",
"message": "%s (%s): sample_set edited" % (request.vars["name"], request.vars["sample_set_id"])}
log.info(res, extra={'user_id': auth.user.id, 'record_id': request.vars['id'], 'table_name': 'generic'})
......
Supports Markdown
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