Commit 3208dad1e7e0c1eeb638e5a2779a290ed9c3e73a
1 parent
99eb9607
Exists in
master
and in
4 other branches
Respect group membership in notification service
Showing
1 changed file
with
4 additions
and
0 deletions
Show diff stats
app/services/notification_service.rb
@@ -174,6 +174,10 @@ class NotificationService | @@ -174,6 +174,10 @@ class NotificationService | ||
174 | 174 | ||
175 | tm = project.users_projects.find_by_user_id(user.id) | 175 | tm = project.users_projects.find_by_user_id(user.id) |
176 | 176 | ||
177 | + if !tm && project.group | ||
178 | + tm = project.users_groups.find_by_user_id(user.id) | ||
179 | + end | ||
180 | + | ||
177 | # reject users who globally disabled notification and has no membership | 181 | # reject users who globally disabled notification and has no membership |
178 | next user.notification.disabled? unless tm | 182 | next user.notification.disabled? unless tm |
179 | 183 |