From 1781548b66ff7c4918d908f1956bf36c420c7476 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 1 Oct 2021 23:48:11 +0200 Subject: [PATCH] fix: page user si pas de nom ni de prenom --- app/views/users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users.py b/app/views/users.py index 253ce5f8..df02f43b 100644 --- a/app/views/users.py +++ b/app/views/users.py @@ -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} # add existing user 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 = [ r.name + "_" + (dept or "") for (r, dept) in displayed_roles ]