Commit 9de9c73c authored by Mathieu Giraud's avatar Mathieu Giraud Committed by Vidjil Team

patient.py: 'compare', if there is no config selected, show samples from all configs

parent f8341d03
......@@ -110,23 +110,20 @@ def custom():
config_name = None
config = False
if config :
query = db(
(auth.accessible_query('read', db.patient) | auth.accessible_query('admin', db.patient) )
q = ((auth.accessible_query('read', db.patient) | auth.accessible_query('admin', db.patient) )
& (db.sequence_file.patient_id==db.patient.id)
& (db.results_file.sequence_file_id==db.sequence_file.id)
& (db.results_file.config_id==str(config_id) )
& (db.results_file.scheduler_task_id==db.scheduler_task.id)
& (db.scheduler_task.status=='COMPLETED')
).select(
orderby = ~db.sequence_file.patient_id|db.sequence_file.id|db.results_file.run_date,
groupby = db.sequence_file.id,
)
else:
query = []
if config:
q &= (db.results_file.config_id==str(config_id) ) # || True) # not config)
query = db(q).select(
orderby = ~db.sequence_file.patient_id|db.sequence_file.id|db.results_file.run_date,
groupby = db.sequence_file.id|db.results_file.config_id,
)
res = {"message": "custom (%s)" % config_name}
log.info(res)
......
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