Commit 2ea249e0 authored by Mathieu Giraud's avatar Mathieu Giraud Committed by Vidjil Team

patient.py: human-readable 'group' list, removing 'admin' and shortening 'user_'

parent c91fbedd
......@@ -258,7 +258,7 @@ def index():
)
for i, row in enumerate(query) :
if row.patient.id in keys :
result[row.patient.id]['group_list'].append(row.auth_group.role)
result[row.patient.id]['group_list'].append(row.auth_group.role.replace('user_','u'))
query = db(
(db.auth_permission.name == "anon") &
......@@ -277,7 +277,7 @@ def index():
for key, row in result.iteritems():
row['most_used_conf'] = max(set(row['conf_id_list']), key=row['conf_id_list'].count)
row['confs'] = ", ".join(list(set(row['conf_list'])))
row['groups'] = ", ".join(list(set(row['group_list'])))
row['groups'] = ", ".join(filter(lambda g: g != 'admin', set(row['group_list'])))
result = result.values()
......
......@@ -23,7 +23,7 @@
{{if not reverse and request.vars["sort"]=="info" :}} , 'reverse' : true {{pass}} })"> info </td>
<td class="pointer" class="column_100" onclick="db.call('patient/index', {'sort' :'configs', 'filter' : '{{=request.vars["filter"]}}'
{{if not reverse and request.vars["sort"]=="configs" :}} , 'reverse' : true {{pass}} })"> configs </td>
{{if isAdmin:}} <td class="column_50 pointer" onclick="db.call('patient/index', {'sort' :'groups', 'filter' : '{{=request.vars["filter"]}}'
{{if isAdmin:}} <td class="column_100 pointer" onclick="db.call('patient/index', {'sort' :'groups', 'filter' : '{{=request.vars["filter"]}}'
{{if not reverse and request.vars["sort"]=="groups" :}} , 'reverse' : true {{pass}} })"> groups </td> {{pass}}
{{if isAdmin:}} <td class="column_100 pointer" onclick="db.call('patient/index', {'sort' :'creator', 'filter' : '{{=request.vars["filter"]}}'
{{if not reverse and request.vars["sort"]=="creator" :}} , 'reverse' : true {{pass}} })"> creator </td> {{pass}}
......
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