Fix Note notification for entities without assignee

master
Dmitriy Zaporozhets 2013-03-28 16:00:19 +02:00
parent 5ad4be295f
commit 583bfac5f5
1 changed files with 4 additions and 1 deletions

View File

@ -109,7 +109,10 @@ class NotificationService
recipients = [note.commit_author]
else
opts.merge!(noteable_id: note.noteable_id)
recipients = [note.noteable.try(:author), note.noteable.try(:assignee)]
target = note.noteable
recipients = []
recipients << target.assignee if target.respond_to?(:assignee)
recipients << target.author if target.respond_to?(:author)
end
# Get users who left comment in thread