Add char field to set a password that is required to join the server

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
[james: Apply yapf formatting]
[james: Minor adjustment to help text]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
schiriki authored and James Valleroy committed 2022-06-18 10:26:51 -04:00
1 parent a7c9248200
commit 7028e3d022
3 files changed
+27

No files matched your search

+9
View File
@@ -35,6 +35,15 @@ class MumbleForm(forms.Form):
required=False,
)
join_password = forms.CharField(
max_length=32,
label=_('Set a password to join the server'),
widget=forms.PasswordInput,
help_text=_('Set a password that is required to join the server. '
'Leave empty to use the current password.'),
required=False,
)
root_channel_name = forms.CharField(
label=_('Set the name for the root channel'),
min_length=1,
+6
View File
@@ -39,6 +39,12 @@ class MumbleAppView(AppView):
messages.success(self.request,
_('SuperUser password successfully updated.'))
join_password = new_config.get('join_password')
if join_password:
actions.superuser_run('mumble',
['change-join-password', join_password])
messages.success(self.request, _('Join password changed'))
name = new_config.get('root_channel_name')
if name:
actions.superuser_run('mumble', ['change-root-channel-name', name])