1
0
forked from ScoDoc/ScoDoc

fix: page user si pas de nom ni de prenom

This commit is contained in:
Emmanuel Viennet 2021-10-01 23:48:11 +02:00
parent 1c927cb541
commit 1781548b66

View File

@ -178,7 +178,7 @@ def create_user_form(user_name=None, edit=0, all_roles=1):
orig_roles_strings = {r.name + "_" + (dept or "") for (r, dept) in orig_roles} orig_roles_strings = {r.name + "_" + (dept or "") for (r, dept) in orig_roles}
# add existing user roles # add existing user roles
displayed_roles = list(editable_roles_set.union(orig_roles)) displayed_roles = list(editable_roles_set.union(orig_roles))
displayed_roles.sort(key=lambda x: (x[1], x[0].name)) displayed_roles.sort(key=lambda x: (x[1] or "", x[0].name or ""))
displayed_roles_strings = [ displayed_roles_strings = [
r.name + "_" + (dept or "") for (r, dept) in displayed_roles r.name + "_" + (dept or "") for (r, dept) in displayed_roles
] ]