From d18ccfac2326be4e9c17e9d670cb0b84a2cce91d Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Thu, 7 Oct 2021 13:13:11 +0200 Subject: [PATCH] Sort aliases by normalized name in profile alias view Signed-off-by: Yohann D'ANELLO --- apps/member/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/member/views.py b/apps/member/views.py index 39edcc0b..fac8bfc6 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -256,7 +256,8 @@ class ProfileAliasView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView): context = super().get_context_data(**kwargs) note = context['object'].note context["aliases"] = AliasTable( - note.alias.filter(PermissionBackend.filter_queryset(self.request, Alias, "view")).distinct().all()) + note.alias.filter(PermissionBackend.filter_queryset(self.request, Alias, "view")).distinct() + .order_by('normalized_name').all()) context["can_create"] = PermissionBackend.check_perm(self.request, "note.add_alias", Alias( note=context["object"].note, name="",