Commit 11b70c97e3a49b6e6235f67452d56612fc141542
1 parent
43c10399
Exists in
master
and in
4 other branches
fix issue notification properly
Showing
1 changed file
with
2 additions
and
4 deletions
Show diff stats
app/controllers/issues_controller.rb
@@ -41,10 +41,8 @@ class IssuesController < ApplicationController | @@ -41,10 +41,8 @@ class IssuesController < ApplicationController | ||
41 | def create | 41 | def create |
42 | @issue = @project.issues.new(params[:issue]) | 42 | @issue = @project.issues.new(params[:issue]) |
43 | @issue.author = current_user | 43 | @issue.author = current_user |
44 | - if @issue.save | ||
45 | - @project.users.reject { |u| u.id == current_user.id } .each do |u| | ||
46 | - Notify.new_issue_email(@issue).deliver | ||
47 | - end | 44 | + if @issue.save && @issue.assignee != current_user |
45 | + Notify.new_issue_email(@issue).deliver | ||
48 | end | 46 | end |
49 | 47 | ||
50 | respond_with(@issue) | 48 | respond_with(@issue) |