summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-31 10:50:10 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-31 10:50:10 +0200
commit8f1274ae0350590a8a0d8f16558d24a9514b78c1 (patch)
tree514a6628a0a45dac10608b408cf3f011c893431b /app/models/user.rb
parent79a7f7b6e59fa1225c440547796331caedabeaab (diff)
parent9a3b283402b8cc1c86802c526f19a459ce09c2e3 (diff)
downloadgitlab-ce-8f1274ae0350590a8a0d8f16558d24a9514b78c1.tar.gz
Merge commit '9a3b283402b8cc1c86802c526f19a459ce09c2e3' into backstage/gb/migrate-stages-statuses
* commit '9a3b283402b8cc1c86802c526f19a459ce09c2e3': (270 commits) Add a note about EFS and GitLab log files Projects logo are not centered vertically on projects page Fix spec/features/projects/branches_spec Fixup POST /v3/:id/hooks and PUT /v3/:id/hooks/:hook_id Fix a spec that was assuming to be on the wrong page Add copy about search terms to ux guide Update documentation of user creation by replacing the 'confirm' param with 'skip_confirmation' Fix replying to commit comments on MRs from forks Fix 500 error when rendering avatar for deleted project creator Load and process at most 100 commits when pushing into default branch Ensure Gitlab::Application.routes.default_url_options are set correctly in Capybara + :js specs Add log messages to clarify log messages about API CSRF token verification failure Update gitlab_flow.md, Teatro seems to be completely dead, see also https://forum.gitlab.com/t/gitlab-flow-documentation-teatro/7774 Fix diff commenting results just after changing view Update CHANGELOG.md for 9.4.2 none is not a CSS Value for sizes ;-) Merge issuable "reopened" state into "opened" Make access level more compatible with EE Add link to JIRA article in docs Expand pipeline_trigger_service_spec by godfat request ...
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index c26be6d05a2..6e66c587a1f 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -76,6 +76,7 @@ class User < ActiveRecord::Base
where(type.not_eq('DeployKey').or(type.eq(nil)))
end, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
has_many :deploy_keys, -> { where(type: 'DeployKey') }, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
+ has_many :gpg_keys
has_many :emails, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
has_many :personal_access_tokens, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
@@ -157,6 +158,7 @@ class User < ActiveRecord::Base
before_save :ensure_authentication_token, :ensure_incoming_email_token
before_save :ensure_user_rights_and_limits, if: :external_changed?
after_save :ensure_namespace_correct
+ after_commit :update_invalid_gpg_signatures, on: :update, if: -> { previous_changes.key?('email') }
after_initialize :set_projects_limit
after_destroy :post_destroy_hook
@@ -512,6 +514,10 @@ class User < ActiveRecord::Base
end
end
+ def update_invalid_gpg_signatures
+ gpg_keys.each(&:update_invalid_gpg_signatures)
+ end
+
# Returns the groups a user has access to
def authorized_groups
union = Gitlab::SQL::Union