Skip to content

Note notification is not send to the author of a commit when using groups

When the author of a commit is listed in the group members of a project, he does not receive note notifications. In the notification service, node.commit_author is called to get the user info. To fix this issue i patched my code of commit_author function in the note model like this :

  def commit_author
    @commit_author ||=
      project.users.find_by_email(noteable.author_email) ||
      project.users.find_by_name(noteable.author_name) ||
      project.group.users.find_by_email(noteable.author_email) ||
      project.group.users.find_by_name(noteable.author_name)
  rescue
    nil
  end