summaryrefslogtreecommitdiff
path: root/app/models/gpg_key.rb
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-06-15 14:22:37 +0200
committerAlexis Reigel <mail@koffeinfrei.org>2017-07-27 15:42:53 +0200
commit24671cd601e93133787ff9746fcacc3cf5d3fbf4 (patch)
treef389ee78c1e75cf5b0db017896dae56f07c61c91 /app/models/gpg_key.rb
parentd48eb77a96d29260c214391c5b8979ee17250452 (diff)
downloadgitlab-ce-24671cd601e93133787ff9746fcacc3cf5d3fbf4.tar.gz
update invalid gpg signatures when key is created
Diffstat (limited to 'app/models/gpg_key.rb')
-rw-r--r--app/models/gpg_key.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/gpg_key.rb b/app/models/gpg_key.rb
index 137abb60ddc..6ca108d6b87 100644
--- a/app/models/gpg_key.rb
+++ b/app/models/gpg_key.rb
@@ -28,6 +28,7 @@ class GpgKey < ActiveRecord::Base
unless: -> { errors.has_key?(:key) }
before_validation :extract_fingerprint, :extract_primary_keyid
+ after_create :update_invalid_gpg_signatures
after_create :notify_user
def key=(value)
@@ -66,6 +67,10 @@ class GpgKey < ActiveRecord::Base
self.primary_keyid = Gitlab::Gpg.primary_keyids_from_key(key).first
end
+ def update_invalid_gpg_signatures
+ run_after_commit { Gitlab::Gpg::InvalidGpgSignatureUpdater.new(self).run }
+ end
+
def notify_user
run_after_commit { NotificationService.new.new_gpg_key(self) }
end