Unwanted notifications #340
This commit is contained in:
parent
61777425d3
commit
9bd4890c32
@ -177,20 +177,22 @@ class DmsfUploadController < ApplicationController
|
||||
end
|
||||
unless files.empty?
|
||||
files.each { |file| log_activity(file, 'uploaded') if file }
|
||||
begin
|
||||
recipients = DmsfMailer.get_notify_users(@project, files)
|
||||
recipients.each do |u|
|
||||
DmsfMailer.files_updated(u, @project, files).deliver
|
||||
end
|
||||
if Setting.plugin_redmine_dmsf[:dmsf_display_notified_recipients] == '1'
|
||||
unless recipients.empty?
|
||||
to = recipients.collect{ |r| r.name }.first(DMSF_MAX_NOTIFICATION_RECEIVERS_INFO).join(', ')
|
||||
to << ((recipients.count > DMSF_MAX_NOTIFICATION_RECEIVERS_INFO) ? ',...' : '.')
|
||||
flash[:warning] = l(:warning_email_notifications, :to => to)
|
||||
if (@folder && @folder.notification?) || (!@folder && @project.dmsf_notification?)
|
||||
begin
|
||||
recipients = DmsfMailer.get_notify_users(@project, files)
|
||||
recipients.each do |u|
|
||||
DmsfMailer.files_updated(u, @project, files).deliver
|
||||
end
|
||||
if Setting.plugin_redmine_dmsf[:dmsf_display_notified_recipients] == '1'
|
||||
unless recipients.empty?
|
||||
to = recipients.collect{ |r| r.name }.first(DMSF_MAX_NOTIFICATION_RECEIVERS_INFO).join(', ')
|
||||
to << ((recipients.count > DMSF_MAX_NOTIFICATION_RECEIVERS_INFO) ? ',...' : '.')
|
||||
flash[:warning] = l(:warning_email_notifications, :to => to)
|
||||
end
|
||||
end
|
||||
rescue Exception => e
|
||||
Rails.logger.error "Could not send email notifications: #{e.message}"
|
||||
end
|
||||
rescue Exception => e
|
||||
Rails.logger.error "Could not send email notifications: #{e.message}"
|
||||
end
|
||||
end
|
||||
unless failed_uploads.empty?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user