summaryrefslogtreecommitdiff
path: root/app/controllers/profiles/gpg_keys_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/profiles/gpg_keys_controller.rb')
-rw-r--r--app/controllers/profiles/gpg_keys_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/profiles/gpg_keys_controller.rb b/app/controllers/profiles/gpg_keys_controller.rb
index 6779cc6ddac..689c76059f6 100644
--- a/app/controllers/profiles/gpg_keys_controller.rb
+++ b/app/controllers/profiles/gpg_keys_controller.rb
@@ -7,9 +7,9 @@ class Profiles::GpgKeysController < Profiles::ApplicationController
end
def create
- @gpg_key = current_user.gpg_keys.new(gpg_key_params)
+ @gpg_key = GpgKeys::CreateService.new(current_user, gpg_key_params).execute
- if @gpg_key.save
+ if @gpg_key.persisted?
redirect_to profile_gpg_keys_path
else
@gpg_keys = current_user.gpg_keys.select(&:persisted?)