forked from ScoDoc/ScoDoc
Fix: département par défaut edition utilisateur
This commit is contained in:
parent
9f45f1ee71
commit
c88b6b7759
@ -459,8 +459,16 @@ def create_user_form(user_name=None, edit=0, all_roles=True):
|
||||
]
|
||||
# Si SuperAdmin, propose de choisir librement le dept du nouvel utilisateur
|
||||
selectable_dept_acronyms = set(administrable_dept_acronyms)
|
||||
if edit and the_user.dept is not None: # ajoute dept actuel de l'utilisateur
|
||||
if edit:
|
||||
if the_user.dept is not None: # ajoute dept actuel de l'utilisateur
|
||||
selectable_dept_acronyms |= {the_user.dept}
|
||||
default_dept = the_user.dept
|
||||
else:
|
||||
default_dept = (
|
||||
g.scodoc_dept
|
||||
if g.scodoc_dept in selectable_dept_acronyms
|
||||
else (auth_dept or "")
|
||||
)
|
||||
if is_super_admin and len(selectable_dept_acronyms) > 1:
|
||||
selectable_dept_acronyms = sorted(list(selectable_dept_acronyms))
|
||||
descr.append(
|
||||
@ -472,9 +480,7 @@ def create_user_form(user_name=None, edit=0, all_roles=True):
|
||||
"explanation": """département de rattachement de l'utilisateur""",
|
||||
"labels": selectable_dept_acronyms,
|
||||
"allowed_values": selectable_dept_acronyms,
|
||||
"default": g.scodoc_dept
|
||||
if g.scodoc_dept in selectable_dept_acronyms
|
||||
else (auth_dept or ""),
|
||||
"default": default_dept,
|
||||
},
|
||||
)
|
||||
)
|
||||
|
@ -1,7 +1,7 @@
|
||||
# -*- mode: python -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
SCOVERSION = "9.4.65"
|
||||
SCOVERSION = "9.4.66"
|
||||
|
||||
SCONAME = "ScoDoc"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user