diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-18 18:09:21 -0200 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-20 12:12:05 -0200 |
commit | 44656136475d8842628d0a1112aecc9ec412a16f (patch) | |
tree | efd13354ac1292ee7443222e2267e2bfa2632ea7 /app | |
parent | 424cb9ccaef35717bd934dd48f8bd69515210a50 (diff) | |
download | gitlab-ce-44656136475d8842628d0a1112aecc9ec412a16f.tar.gz |
Explicit mention of the assignee make a task
Since potentially the previous assign-task has already been handled.
Diffstat (limited to 'app')
-rw-r--r-- | app/services/task_service.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/services/task_service.rb b/app/services/task_service.rb index cdd025eadc5..bfd724a0f51 100644 --- a/app/services/task_service.rb +++ b/app/services/task_service.rb @@ -150,7 +150,6 @@ class TaskService end mentioned_users.delete(author) - mentioned_users.delete(target.assignee) if target.respond_to?(:assignee) mentioned_users.uniq end @@ -177,6 +176,7 @@ class TaskService end mentioned_users = build_mentioned_users(project, target, author) + mentioned_users.delete(issuable.assignee) mentioned_users.each do |mentioned_user| create_task(project, target, author, mentioned_user, Task::MENTIONED) @@ -185,16 +185,15 @@ class TaskService def update_issuable(issuable, current_user) project = issuable.project - target = issuable author = current_user - mark_pending_tasks_as_done(target, author) + mark_pending_tasks_as_done(issuable, author) - mentioned_users = build_mentioned_users(project, target, author) + mentioned_users = build_mentioned_users(project, issuable, author) mentioned_users.each do |mentioned_user| - unless pending_tasks(mentioned_user, project, target, action: Task::MENTIONED).exists? - create_task(project, target, author, mentioned_user, Task::MENTIONED) + unless pending_tasks(mentioned_user, project, issuable, action: Task::MENTIONED).exists? + create_task(project, issuable, author, mentioned_user, Task::MENTIONED) end end end |