Commit 7e097da7 authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'prod-server' into 'dev'

Faster patient list loading

Closes #3139, #3141, #3169, and #2525

See merge request !187
parents f25492ca 81aac836
Pipeline #22293 failed with stages
in 46 seconds
......@@ -38,7 +38,7 @@ def home():
if auth.is_admin():
redirect = URL('admin', 'index', scheme=True, host=True)
else:
redirect = URL('sample_set', 'all', vars={'type': defs.SET_TYPE_PATIENT}, scheme=True, host=True)
redirect = URL('sample_set', 'all', vars={'type': defs.SET_TYPE_PATIENT, 'page': 0}, scheme=True, host=True)
res = {"redirect" : redirect}
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
......
......@@ -146,17 +146,18 @@ def index():
## return a list of generic sample_sets
def all():
start = time.time()
if request.vars['type']:
type = request.vars['type']
else :
type = defs.SET_TYPE_GENERIC
if not auth.user :
res = {"redirect" : URL('default', 'user', args='login', scheme=True, host=True,
vars=dict(_next=URL('sample_set', 'all', vars={'type': defs.SET_TYPE_PATIENT}, scheme=True, host=True)))
vars=dict(_next=URL('sample_set', 'all', vars={'type': type, 'page': 0}, scheme=True, host=True)))
}
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
isAdmin = auth.is_admin()
if request.vars['type']:
type = request.vars['type']
else :
type = defs.SET_TYPE_GENERIC
step = None
page = None
......@@ -515,7 +516,7 @@ def submit():
"message": msg}
else:
res = {"redirect": "sample_set/all",
"args" : { "type" : length_mapping[max_num] },
"args" : { "type" : length_mapping[max_num], "page": 0 },
"message": msg}
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
else:
......@@ -691,7 +692,7 @@ def delete():
db(db.sample_set.id == sample_set.id).delete()
res = {"redirect": "sample_set/all",
"args": {"type": sample_type},
"args": {"type": sample_type, "page": 0},
"success": "true",
"message": "sample set ("+str(request.vars["id"])+") deleted"}
log.info(res, extra={'user_id': auth.user.id, 'record_id': request.vars["id"], 'table_name': 'sample_set'})
......
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