mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
users: Display error message if unable to set SSH keys
This commit is contained in:
parent
b8f3502a6f
commit
d2950d9c5f
@ -207,9 +207,15 @@ class UserUpdateForm(ValidNewUsernameCheckMixin, forms.ModelForm):
|
|||||||
messages.error(self.request,
|
messages.error(self.request,
|
||||||
_('Failed to add user to group.'))
|
_('Failed to add user to group.'))
|
||||||
|
|
||||||
actions.superuser_run(
|
try:
|
||||||
'ssh', ['set-keys', '--username', user.get_username(),
|
actions.superuser_run(
|
||||||
'--keys', self.cleaned_data['ssh_keys'].strip()])
|
'ssh', ['set-keys', '--username', user.get_username(),
|
||||||
|
'--keys', self.cleaned_data['ssh_keys'].strip()])
|
||||||
|
except ActionError:
|
||||||
|
messages.error(
|
||||||
|
self.request,
|
||||||
|
_('Unable to set SSH keys. Please wait a minute and then '
|
||||||
|
'try again.'))
|
||||||
|
|
||||||
return user
|
return user
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user