diff --git a/openslides/participant/forms.py b/openslides/participant/forms.py index aedff5126..4687432fe 100644 --- a/openslides/participant/forms.py +++ b/openslides/participant/forms.py @@ -113,3 +113,6 @@ class ConfigForm(forms.Form, CssClassMixin): required=False, label=_("Welcome text"), help_text=_("Printed in PDF of first time passwords only.")) + participant_sort_users_by_first_name = forms.BooleanField( + required=False, + label=_("Sort users by first name")) diff --git a/openslides/participant/models.py b/openslides/participant/models.py index f0b420f05..99581cd37 100644 --- a/openslides/participant/models.py +++ b/openslides/participant/models.py @@ -177,6 +177,7 @@ def default_config(sender, key, **kwargs): return { 'participant_pdf_system_url': 'http://example.com:8000', 'participant_pdf_welcometext': _('Welcome to OpenSlides!'), + 'participant_sort_users_by_first_name': False, }.get(key) diff --git a/openslides/participant/views.py b/openslides/participant/views.py index f4bbb8448..1cc4dbc72 100644 --- a/openslides/participant/views.py +++ b/openslides/participant/views.py @@ -412,13 +412,16 @@ class Config(FormView): def get_initial(self): return { 'participant_pdf_system_url': config['participant_pdf_system_url'], - 'participant_pdf_welcometext': config['participant_pdf_welcometext']} + 'participant_pdf_welcometext': config['participant_pdf_welcometext'], + 'participant_sort_users_by_first_name': config['participant_sort_users_by_first_name']} def form_valid(self, form): config['participant_pdf_system_url'] = ( form.cleaned_data['participant_pdf_system_url']) config['participant_pdf_welcometext'] = ( form.cleaned_data['participant_pdf_welcometext']) + config['participant_sort_users_by_first_name'] = ( + form.cleaned_data['participant_sort_users_by_first_name']) messages.success( self.request, _('Participants settings successfully saved.'))