]> source.dussan.org Git - redmine.git/commitdiff
Fixed: don't reset watchers when changing tracker. #6479
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Sun, 26 Sep 2010 13:52:25 +0000 (13:52 +0000)
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Sun, 26 Sep 2010 13:52:25 +0000 (13:52 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4181 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb

index 385bfa75749baeeec7f22098c5c6897bf3212992..a48a9e8fffd1d84209eac8e2351bce6e5c8460cb 100644 (file)
@@ -284,6 +284,7 @@ private
   end
 
   # TODO: Refactor, lots of extra code in here
+  # TODO: Changing tracker on an existing issue should not trigger this
   def build_new_issue_from_params
     if params[:id].blank?
       @issue = Issue.new
@@ -302,7 +303,9 @@ private
     end
     if params[:issue].is_a?(Hash)
       @issue.safe_attributes = params[:issue]
-      @issue.watcher_user_ids = params[:issue]['watcher_user_ids'] if User.current.allowed_to?(:add_issue_watchers, @project)
+      if User.current.allowed_to?(:add_issue_watchers, @project) && @issue.new_record?
+        @issue.watcher_user_ids = params[:issue]['watcher_user_ids']
+      end
     end
     @issue.author = User.current
     @issue.start_date ||= Date.today