Insert new config var for sorting Users by first_name
This commit is contained in:
parent
f8d3390c78
commit
f41fe87656
@ -113,3 +113,6 @@ class ConfigForm(forms.Form, CssClassMixin):
|
|||||||
required=False,
|
required=False,
|
||||||
label=_("Welcome text"),
|
label=_("Welcome text"),
|
||||||
help_text=_("Printed in PDF of first time passwords only."))
|
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"))
|
||||||
|
@ -177,6 +177,7 @@ def default_config(sender, key, **kwargs):
|
|||||||
return {
|
return {
|
||||||
'participant_pdf_system_url': 'http://example.com:8000',
|
'participant_pdf_system_url': 'http://example.com:8000',
|
||||||
'participant_pdf_welcometext': _('Welcome to OpenSlides!'),
|
'participant_pdf_welcometext': _('Welcome to OpenSlides!'),
|
||||||
|
'participant_sort_users_by_first_name': False,
|
||||||
}.get(key)
|
}.get(key)
|
||||||
|
|
||||||
|
|
||||||
|
@ -412,13 +412,16 @@ class Config(FormView):
|
|||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
return {
|
return {
|
||||||
'participant_pdf_system_url': config['participant_pdf_system_url'],
|
'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):
|
def form_valid(self, form):
|
||||||
config['participant_pdf_system_url'] = (
|
config['participant_pdf_system_url'] = (
|
||||||
form.cleaned_data['participant_pdf_system_url'])
|
form.cleaned_data['participant_pdf_system_url'])
|
||||||
config['participant_pdf_welcometext'] = (
|
config['participant_pdf_welcometext'] = (
|
||||||
form.cleaned_data['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(
|
messages.success(
|
||||||
self.request,
|
self.request,
|
||||||
_('Participants settings successfully saved.'))
|
_('Participants settings successfully saved.'))
|
||||||
|
Loading…
Reference in New Issue
Block a user