Commit 583bfac5 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix Note notification for entities without assignee

parent 5ad4be29
......@@ -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
......
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