summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-17 17:55:45 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-20 12:12:05 -0200
commit4120b7941d75217d013dcc9612e3e5dff76f10d5 (patch)
tree1c867ee085fab2e1b18f79e830e463d2eaa5d305 /app/services
parent1d476b0656b3ec24e264d7a7c30bdca83704b3bd (diff)
downloadgitlab-ce-4120b7941d75217d013dcc9612e3e5dff76f10d5.tar.gz
Does not create a task if new assignee is the current user
Diffstat (limited to 'app/services')
-rw-r--r--app/services/task_service.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/services/task_service.rb b/app/services/task_service.rb
index d97fa146f5c..c9b30bcb19c 100644
--- a/app/services/task_service.rb
+++ b/app/services/task_service.rb
@@ -125,7 +125,6 @@ class TaskService
mentioned_users.delete(author)
mentioned_users.delete(target.assignee) if target.respond_to?(:assignee)
-
mentioned_users.uniq
end
@@ -149,9 +148,9 @@ class TaskService
end
end
- def reassigned_issuable(issuable, user)
- if issuable.is_assigned?
- create_task(issuable.project, issuable, user, issuable.assignee, Task::ASSIGNED)
+ def reassigned_issuable(issuable, current_user)
+ if issuable.is_assigned? && issuable.assignee != current_user
+ create_task(issuable.project, issuable, current_user, issuable.assignee, Task::ASSIGNED)
end
end
end