diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-02-28 15:25:12 +0100 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-27 15:42:04 +0200 |
commit | 8bd94a7304d392ad030295b5dfcd84c0100eddd1 (patch) | |
tree | 0e08bcdb460ad21c25646f686a42f4b743bf0129 /app/models/user.rb | |
parent | c1281982bd7975b45bed5b8e2c5ef5e242ea18fd (diff) | |
download | gitlab-ce-8bd94a7304d392ad030295b5dfcd84c0100eddd1.tar.gz |
remove gpg from keychain when user's email changes
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 5aebd36cf8a..42c83e3d206 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -155,6 +155,7 @@ class User < ActiveRecord::Base before_validation :set_public_email, if: :public_email_changed? after_update :update_emails_with_primary_email, if: :email_changed? + after_update :synchronize_gpg_keys, if: :email_changed? before_save :ensure_authentication_token, :ensure_incoming_email_token before_save :ensure_user_rights_and_limits, if: :external_changed? after_save :ensure_namespace_correct @@ -1157,4 +1158,10 @@ class User < ActiveRecord::Base ensure Gitlab::ExclusiveLease.cancel(lease_key, uuid) end + + def synchronize_gpg_keys + gpg_keys.each do |gpg_key| + gpg_key.synchronize_keychain + end + end end |