mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
Show error messages from xmpp-setup and xmpp-register.
Avoid causing plinth to show error page.
This commit is contained in:
1 parent
9d6e17660d
commit
ac0f0c9eba
3 files changed
+12
-5
No files matched your search
@@ -127,14 +127,21 @@ def _apply_changes(request, old_status, new_status):
|
||||
return
|
||||
|
||||
if new_status['inband_enabled']:
|
||||
messages.success(request, _('Inband registration enabled'))
|
||||
option = 'inband_enable'
|
||||
else:
|
||||
messages.success(request, _('Inband registration disabled'))
|
||||
option = 'noinband_enable'
|
||||
|
||||
LOGGER.info('Option - %s', option)
|
||||
actions.superuser_run('xmpp-setup', [option])
|
||||
output = actions.superuser_run('xmpp-setup', [option])
|
||||
|
||||
if 'Failed' in output:
|
||||
messages.error(request,
|
||||
_('Error when configuring XMPP server: %s') %
|
||||
output)
|
||||
elif option == 'inband_enable':
|
||||
messages.success(request, _('Inband registration enabled'))
|
||||
else:
|
||||
messages.success(request, _('Inband registration disabled'))
|
||||
|
||||
|
||||
class RegisterForm(forms.Form): # pylint: disable-msg=W0232
|
||||
|
||||
Reference in new issue
Block a user