From 2c11bf5e37794b1ae7c6562f020dd1aa9d48f537 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Wed, 16 Sep 2020 14:59:56 +0200 Subject: [PATCH] personal: Sort groups by name in filter --- mpicms/personal/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpicms/personal/views.py b/mpicms/personal/views.py index 207d043..740eeca 100644 --- a/mpicms/personal/views.py +++ b/mpicms/personal/views.py @@ -16,7 +16,7 @@ def get_queryset(self): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - context['groups'] = Group.objects.all() + context['groups'] = Group.objects.all().order_by("name") group_pk = self.request.GET.get('group') context['selected_group_pk'] = group_pk context['selected_group'] = get_object_or_404(Group, pk=group_pk) if group_pk else ""