Commit 43e9c6bb authored by HERBERT Ryan's avatar HERBERT Ryan
Browse files

group selector is now devel-mode. user group is selected by default unless...

group selector is now devel-mode. user group is selected by default unless Lille is in the list. In which case Lille is selected
parent 60868908
......@@ -256,7 +256,11 @@ def add():
groups = db(db.auth_group).select(db.auth_group.id, db.auth_group.role)
else:
groups = auth.get_user_groups()
return dict(message=T('add patient'), groups=groups)
master_group = auth.user_group()
for row in groups:
if row.role == 'Lille':
master_group = row.id
return dict(message=T('add patient'), groups=groups, master_group=master_group)
else :
res = {"message": ACCESS_DENIED}
log.error(res)
......
......@@ -8,10 +8,10 @@
<td><input class="date" id="patient_id_label" name="id_label" type="text" value=""><span></span></td>
<td></td>
</tr>
<tr>
<tr class='devel-mode'>
<td><label for="patient_group" id="patient_group__label">Owner Group: </label></td>
<td>
{{= SELECT(*[OPTION(g.role, _value=g.id) for g in groups], _name="patient_group") }}
{{= SELECT(*[OPTION(g.role, _value=g.id) for g in groups], _name="patient_group", _value=master_group, value=master_group) }}
</td>
<td></td>
</tr>
......
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