diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-25 15:12:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-25 15:12:20 +0300 |
commit | 73507eaf1a77c5c05ae17c9f7ac29bbeb8bf5be1 (patch) | |
tree | 7f9b8b4246b9d0ce354866b07f4e9f657ac9665d /app/models/group.rb | |
parent | 86ace8a66caeb11a2912e15e8a9abc3d9e4960c2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/group.rb')
-rw-r--r-- | app/models/group.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/group.rb b/app/models/group.rb index e0d10030b9f..a1eece54f0c 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -153,7 +153,7 @@ class Group < Namespace after_create :post_create_hook after_destroy :post_destroy_hook - after_save :update_two_factor_requirement + after_commit :update_two_factor_requirement after_update :path_changed_hook, if: :saved_change_to_path? after_create -> { create_or_load_association(:group_feature) } @@ -898,6 +898,10 @@ class Group < Namespace end end + def update_two_factor_requirement_for_members + direct_and_indirect_members.find_each(&:update_two_factor_requirement) + end + private def feature_flag_enabled_for_self_or_ancestor?(feature_flag) @@ -920,7 +924,7 @@ class Group < Namespace def update_two_factor_requirement return unless saved_change_to_require_two_factor_authentication? || saved_change_to_two_factor_grace_period? - direct_and_indirect_members.find_each(&:update_two_factor_requirement) + Groups::UpdateTwoFactorRequirementForMembersWorker.perform_async(self.id) end def path_changed_hook |