##// END OF EJS Templates
Fixed: locked users should not receive email notifications....
Jean-Philippe Lang -
r1061:3e031b4243b3
parent child
Show More
@@ -190,9 +190,9 class Issue < ActiveRecord::Base
190 190 # Returns the mail adresses of users that should be notified for the issue
191 191 def recipients
192 192 recipients = project.recipients
193 # Author and assignee are always notified
194 recipients << author.mail if author
195 recipients << assigned_to.mail if assigned_to
193 # Author and assignee are always notified unless they have been locked
194 recipients << author.mail if author && author.active?
195 recipients << assigned_to.mail if assigned_to && assigned_to.active?
196 196 recipients.compact.uniq
197 197 end
198 198
@@ -18,7 +18,7
18 18 class MessageObserver < ActiveRecord::Observer
19 19 def after_create(message)
20 20 # send notification to the authors of the thread
21 recipients = ([message.root] + message.root.children).collect {|m| m.author.mail if m.author}
21 recipients = ([message.root] + message.root.children).collect {|m| m.author.mail if m.author && m.author.active?}
22 22 # send notification to the board watchers
23 23 recipients += message.board.watcher_recipients
24 24 recipients = recipients.compact.uniq
@@ -37,7 +37,7 module Redmine
37 37 end
38 38
39 39 def watcher_recipients
40 self.watchers.collect { |w| w.user.mail }
40 self.watchers.collect { |w| w.user.mail if w.user.active? }.compact
41 41 end
42 42
43 43 module ClassMethods
General Comments 0
You need to be logged in to leave comments. Login now