Fix Note notification for entities without assignee
This commit is contained in:
parent
5ad4be295f
commit
583bfac5f5
1 changed files with 4 additions and 1 deletions
|
@ -109,7 +109,10 @@ class NotificationService
|
||||||
recipients = [note.commit_author]
|
recipients = [note.commit_author]
|
||||||
else
|
else
|
||||||
opts.merge!(noteable_id: note.noteable_id)
|
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
|
end
|
||||||
|
|
||||||
# Get users who left comment in thread
|
# Get users who left comment in thread
|
||||||
|
|
Loading…
Reference in a new issue