Fix: création utilisateur si un seul département

This commit is contained in:
Emmanuel Viennet 2024-04-12 15:50:53 +02:00
parent 0a2e39cae1
commit 1ddf9b6ab8
1 changed files with 3 additions and 3 deletions

View File

@ -504,7 +504,7 @@ def create_user_form(user_name=None, edit=0, all_roles=True):
if g.scodoc_dept in selectable_dept_acronyms if g.scodoc_dept in selectable_dept_acronyms
else (auth_dept or "") else (auth_dept or "")
) )
if len(selectable_dept_acronyms) > 1: if len(selectable_dept_acronyms) > 0:
selectable_dept_acronyms = sorted(list(selectable_dept_acronyms)) selectable_dept_acronyms = sorted(list(selectable_dept_acronyms))
descr.append( descr.append(
( (
@ -529,7 +529,7 @@ def create_user_form(user_name=None, edit=0, all_roles=True):
{ {
"input_type": "separator", "input_type": "separator",
"title": f"""L'utilisateur appartient au département { "title": f"""L'utilisateur appartient au département {
the_user.dept or "(tous)"}""", the_user.dept or "(tous/aucun)"}""",
}, },
) )
) )
@ -539,7 +539,7 @@ def create_user_form(user_name=None, edit=0, all_roles=True):
"d", "d",
{ {
"input_type": "separator", "input_type": "separator",
"title": f"L'utilisateur sera créé dans le département {auth_dept}", "title": f"L'utilisateur sera créé dans le département {auth_dept or 'aucun'}",
}, },
) )
) )