diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-10-04 19:24:23 +0300 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-10-09 16:12:39 +0300 |
commit | d6612fbcee7245325ee9799f49b5ea46a5037308 (patch) | |
tree | 43468fecebbfa7fefe33d4cedf71df552b3d2e31 /app/services/todo_service.rb | |
parent | f277fa14094e5515e2317d2baa1fa0bfb95966da (diff) |
Don't create todos for old issue assignees
Diffstat (limited to 'app/services/todo_service.rb')
-rw-r--r-- | app/services/todo_service.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/services/todo_service.rb b/app/services/todo_service.rb index 6ee96d6a0f8..b6125cafa83 100644 --- a/app/services/todo_service.rb +++ b/app/services/todo_service.rb @@ -43,8 +43,8 @@ class TodoService # # * create a pending todo for new assignee if issue is assigned # - def reassigned_issue(issue, current_user) - create_assignment_todo(issue, current_user) + def reassigned_issue(issue, current_user, old_assignees = []) + create_assignment_todo(issue, current_user, old_assignees) end # When create a merge request we should: @@ -254,10 +254,11 @@ class TodoService create_mention_todos(project, target, author, note, skip_users) end - def create_assignment_todo(issuable, author) + def create_assignment_todo(issuable, author, old_assignees = []) if issuable.assignees.any? + assignees = issuable.assignees - old_assignees attributes = attributes_for_todo(issuable.project, issuable, author, Todo::ASSIGNED) - create_todos(issuable.assignees, attributes) + create_todos(assignees, attributes) end end |