Commit e39d9371 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'ee-5063-to-ce-backport' into 'master'

Backports changes made in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5063 to CE

See merge request gitlab-org/gitlab-ce!17909
parents a27011f6 15a72e05
...@@ -230,13 +230,13 @@ class Group < Namespace ...@@ -230,13 +230,13 @@ class Group < Namespace
end end
GroupMember GroupMember
.active_without_invites .active_without_invites_and_requests
.where(source_id: source_ids) .where(source_id: source_ids)
end end
def members_with_descendants def members_with_descendants
GroupMember GroupMember
.active_without_invites .active_without_invites_and_requests
.where(source_id: self_and_descendants.reorder(nil).select(:id)) .where(source_id: self_and_descendants.reorder(nil).select(:id))
end end
......
...@@ -52,7 +52,7 @@ class Member < ActiveRecord::Base ...@@ -52,7 +52,7 @@ class Member < ActiveRecord::Base
end end
# Like active, but without invites. For when a User is required. # Like active, but without invites. For when a User is required.
scope :active_without_invites, -> do scope :active_without_invites_and_requests, -> do
left_join_users left_join_users
.where(users: { state: 'active' }) .where(users: { state: 'active' })
.non_request .non_request
......
...@@ -208,9 +208,9 @@ class NotificationService ...@@ -208,9 +208,9 @@ class NotificationService
def new_access_request(member) def new_access_request(member)
return true unless member.notifiable?(:subscription) return true unless member.notifiable?(:subscription)
recipients = member.source.members.active_without_invites.owners_and_masters recipients = member.source.members.active_without_invites_and_requests.owners_and_masters
if fallback_to_group_owners_masters?(recipients, member) if fallback_to_group_owners_masters?(recipients, member)
recipients = member.source.group.members.active_without_invites.owners_and_masters recipients = member.source.group.members.active_without_invites_and_requests.owners_and_masters
end end
recipients.each { |recipient| deliver_access_request_email(recipient, member) } recipients.each { |recipient| deliver_access_request_email(recipient, member) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment