From e5c132e34cdea1d97b4456bdf7a05ef64a7298e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Fri, 14 Sep 2012 02:46:43 +0200 Subject: [PATCH] Use new config var for sorting users --- openslides/participant/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openslides/participant/models.py b/openslides/participant/models.py index 99581cd37..662dcf9e3 100644 --- a/openslides/participant/models.py +++ b/openslides/participant/models.py @@ -19,6 +19,7 @@ from django.utils.translation import ugettext_lazy as _, ugettext_noop from openslides.utils.person import PersonMixin from openslides.utils.person.signals import receive_persons +from openslides.config.models import config from openslides.config.signals import default_config_value @@ -134,7 +135,10 @@ class UsersAndGroupsToPersons(object): def __init__(self, person_prefix_filter=None, id_filter=None): self.person_prefix_filter = person_prefix_filter self.id_filter = id_filter - self.users = User.objects.all().order_by('last_name') + if config['participant_sort_users_by_first_name']: + self.users = User.objects.all().order_by('first_name') + else: + self.users = User.objects.all().order_by('last_name') self.groups = Group.objects.filter(group_as_person=True).order_by('name') def __iter__(self):