diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-20 18:40:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-20 18:40:28 +0300 |
commit | b595cb0c1dec83de5bdee18284abe86614bed33b (patch) | |
tree | 8c3d4540f193c5ff98019352f554e921b3a41a72 /app/controllers/users_controller.rb | |
parent | 2f9104a328fc8a4bddeaa4627b595166d24671d0 (diff) |
Add latest changes from gitlab-org/gitlab@15-2-stable-eev15.2.0-rc42
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r-- | app/controllers/users_controller.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 2799479d922..eaf08cd421b 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -58,7 +58,9 @@ class UsersController < ApplicationController # Get all keys of a user(params[:username]) in a text format # Helpful for sysadmins to put in respective servers def ssh_keys - render plain: user.all_ssh_keys.join("\n") + keys = user.all_ssh_keys.join("\n") + keys << "\n" unless keys.empty? + render plain: keys end def activity @@ -74,7 +76,9 @@ class UsersController < ApplicationController # Get all gpg keys of a user(params[:username]) in a text format def gpg_keys - render plain: user.gpg_keys.select(&:verified?).map(&:key).join("\n") + keys = user.gpg_keys.filter_map { |gpg_key| gpg_key.key if gpg_key.verified? }.join("\n") + keys << "\n" unless keys.empty? + render plain: keys end def groups |