Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
15a72e05
Commit
15a72e05
authored
Mar 21, 2018
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backports changes made in
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5063
to CE
parent
40c338a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
app/models/group.rb
app/models/group.rb
+2
-2
app/models/member.rb
app/models/member.rb
+1
-1
app/services/notification_service.rb
app/services/notification_service.rb
+2
-2
No files found.
app/models/group.rb
View file @
15a72e05
...
...
@@ -230,13 +230,13 @@ class Group < Namespace
end
GroupMember
.
active_without_invites
.
active_without_invites
_and_requests
.
where
(
source_id:
source_ids
)
end
def
members_with_descendants
GroupMember
.
active_without_invites
.
active_without_invites
_and_requests
.
where
(
source_id:
self_and_descendants
.
reorder
(
nil
).
select
(
:id
))
end
...
...
app/models/member.rb
View file @
15a72e05
...
...
@@ -52,7 +52,7 @@ class Member < ActiveRecord::Base
end
# 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
.
where
(
users:
{
state:
'active'
})
.
non_request
...
...
app/services/notification_service.rb
View file @
15a72e05
...
...
@@ -208,9 +208,9 @@ class NotificationService
def
new_access_request
(
member
)
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
)
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
recipients
.
each
{
|
recipient
|
deliver_access_request_email
(
recipient
,
member
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment