diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-01 21:09:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-01 21:09:24 +0000 |
commit | 039bf0d863d2137484f7d89361352e2c20d142e9 (patch) | |
tree | 1f97591c4994afa0942e3218af135c13768d0fae /app/models/member.rb | |
parent | 1c7a88b121670eb5732ff4ddac3a2121fb36395a (diff) | |
download | gitlab-ce-039bf0d863d2137484f7d89361352e2c20d142e9.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/member.rb')
-rw-r--r-- | app/models/member.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/member.rb b/app/models/member.rb index bd5713bf378..77e3a758605 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -22,6 +22,7 @@ class Member < ApplicationRecord STATE_AWAITING = 1 attr_accessor :raw_invite_token + attr_writer :blocking_refresh belongs_to :created_by, class_name: "User" belongs_to :user @@ -201,7 +202,7 @@ class Member < ApplicationRecord after_save :log_invitation_token_cleanup after_commit on: [:create, :update], unless: :importing? do - refresh_member_authorized_projects(blocking: true) + refresh_member_authorized_projects(blocking: blocking_refresh) end after_commit on: [:destroy], unless: :importing? do @@ -513,6 +514,13 @@ class Member < ApplicationRecord error = StandardError.new("Invitation token is present but invite was already accepted!") Gitlab::ErrorTracking.track_exception(error, attributes.slice(%w["invite_accepted_at created_at source_type source_id user_id id"])) end + + def blocking_refresh + return true unless Feature.enabled?(:allow_non_blocking_member_refresh, default_enabled: :yaml) + return true if @blocking_refresh.nil? + + @blocking_refresh + end end Member.prepend_mod_with('Member') |