diff --git a/CHANGELOG.md b/CHANGELOG.md index 3676a8095..c5ca90155 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ All notable changes to this project will be documented in this file. - networks: Fixed incorrect access for retrieving DNS entries. - Fixed issue with lost menus in Django 1.10. - Added workaround for script prefix problem in stronghold. +- users: Fixed editing users without SSH keys. ### Changed - Added suggested packages for ikiwiki. Removed recommends since they diff --git a/plinth/modules/users/views.py b/plinth/modules/users/views.py index 3c56d0412..253f759e6 100644 --- a/plinth/modules/users/views.py +++ b/plinth/modules/users/views.py @@ -88,8 +88,13 @@ class UserUpdate(ContextMixin, SuccessMessageMixin, UpdateView): def get_initial(self): """Return the data for initial form load.""" initial = super(UserUpdate, self).get_initial() - initial['ssh_keys'] = actions.superuser_run( - 'ssh', ['get-keys', '--username', self.object.username]).strip() + try: + ssh_keys = actions.superuser_run( + 'ssh', ['get-keys', '--username', self.object.username]) + initial['ssh_keys'] = ssh_keys.strip() + except ActionError: + pass + return initial def get_success_url(self):