diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-11-03 08:40:00 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-11-03 08:40:00 +0000 |
commit | 354256d04c704209d65d21c967d947aa577f6a20 (patch) | |
tree | 0000c1c17f9c57cafea176421d8007a66914ca4a /app/controllers/profiles | |
parent | d51ad1ea6407d3cb9eafd9fc891c7348b10b108f (diff) | |
parent | 9cb9a86f37e89ad181a6a4d024240752c50606c9 (diff) | |
download | gitlab-ce-354256d04c704209d65d21c967d947aa577f6a20.tar.gz |
Merge branch 'refactor-services-for-audit-events-ce' into 'master'
[CE] Refactor controller calls into services
Closes gitlab-ee#3544
See merge request gitlab-org/gitlab-ce!15023
Diffstat (limited to 'app/controllers/profiles')
-rw-r--r-- | app/controllers/profiles/keys_controller.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/app/controllers/profiles/keys_controller.rb b/app/controllers/profiles/keys_controller.rb index 069e6a810f2..f0e5d2aa94e 100644 --- a/app/controllers/profiles/keys_controller.rb +++ b/app/controllers/profiles/keys_controller.rb @@ -11,10 +11,10 @@ class Profiles::KeysController < Profiles::ApplicationController end def create - @key = Keys::CreateService.new(current_user, key_params).execute + @key = Keys::CreateService.new(current_user, key_params.merge(ip_address: request.remote_ip)).execute if @key.persisted? - redirect_to_profile_key_path + redirect_to profile_key_path(@key) else @keys = current_user.keys.select(&:persisted?) render :index @@ -50,12 +50,6 @@ class Profiles::KeysController < Profiles::ApplicationController end end - protected - - def redirect_to_profile_key_path - redirect_to profile_key_path(@key) - end - private def key_params |