diff options
author | GitLab <devaroop123@yahoo.co.in> | 2014-02-11 19:04:47 +0530 |
---|---|---|
committer | GitLab <devaroop123@yahoo.co.in> | 2014-02-11 19:04:47 +0530 |
commit | 46ad09bf70400eeebab5495ee6a5ded4da86012e (patch) | |
tree | 0501f89cfaf71108bb95d1a1dbadb1bebf7634f8 /app/controllers | |
parent | 5101ff7bec35704d844df8e608f604abd22df57a (diff) | |
download | gitlab-ce-46ad09bf70400eeebab5495ee6a5ded4da86012e.tar.gz |
code refactor as per standards
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/profiles/keys_controller.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/controllers/profiles/keys_controller.rb b/app/controllers/profiles/keys_controller.rb index 7c97987d006..e8237a1f227 100644 --- a/app/controllers/profiles/keys_controller.rb +++ b/app/controllers/profiles/keys_controller.rb @@ -34,14 +34,17 @@ class Profiles::KeysController < ApplicationController end end - #get all keys of a user(params[:username]) in a text format - #helpful for sysadmins to put in respective servers + # Get all keys of a user(params[:username]) in a text format + # Helpful for sysadmins to put in respective servers def get_keys if params[:username].present? begin user = User.find_by_username(params[:username]) - user.present? ? (render :text => user.all_ssh_keys.join('\n')) : - (render_404 and return) + if user.present? + render text: user.all_ssh_keys.join('\n') + else + render_404 and return + end rescue => e render text: e.message end |