]> source.dussan.org Git - redmine.git/commitdiff
Editing issues no longer sends notifications to previous assignee (#26627).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 15 Oct 2017 16:43:19 +0000 (16:43 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 15 Oct 2017 16:43:19 +0000 (16:43 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@17002 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb
test/unit/issue_test.rb
test/unit/user_test.rb

index 33e6bf2234d21ce9a625291ad6bf3c607729257d..62a02e878dff5810934abe92180ab2b859f74f50 100644 (file)
@@ -116,8 +116,6 @@ class Issue < ActiveRecord::Base
   after_save :after_create_from_copy
   after_destroy :update_parent_attributes
   after_create :send_notification
-  # Keep it at the end of after_save callbacks
-  after_save :clear_assigned_to_was
 
   # Returns a SQL conditions string used to find all issues visible by the specified user
   def self.visible_condition(user, options={})
index 2902c427fb4c7b08f53e9bb2e8ab745080fe5c03..ca038c877d65c2090a8c59a4def0733be2d13db9 100644 (file)
@@ -1883,8 +1883,6 @@ class IssueTest < ActiveSupport::TestCase
     issue = Issue.find(2)
     issue.assigned_to = nil
     assert_include user.mail, issue.recipients
-    issue.save!
-    assert !issue.recipients.include?(user.mail)
   end
 
   def test_recipients_should_not_include_users_that_cannot_view_the_issue
@@ -2443,9 +2441,8 @@ class IssueTest < ActiveSupport::TestCase
 
   def test_update_should_notify_previous_assignee
     ActionMailer::Base.deliveries.clear
-    user = User.find(3)
-    user.members.update_all ["mail_notification = ?", false]
-    user.update! :mail_notification => 'only_assigned'
+    user = User.generate!(:mail_notification => 'only_assigned')
+    Issue.where(:id => 2).update_all(:assigned_to_id => user.id)
 
     with_settings :notified_events => %w(issue_updated) do
       issue = Issue.find(2)
index 858dc3209ac43d9abc18fd270d3948afaf6ccb96..d983eab868224cd73fc1f409b3e702abf5bdf81c 100644 (file)
@@ -1196,10 +1196,6 @@ class UserTest < ActiveSupport::TestCase
     issue.assigned_to = new_assignee
     assert assignee.notify_about?(issue)
     assert new_assignee.notify_about?(issue)
-
-    issue.save!
-    assert !assignee.notify_about?(issue)
-    assert new_assignee.notify_about?(issue)
   end
 
   def test_notify_about_news