mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 09:46:02 +01:00
Adds flash messages to files_controller#create (#19793).
git-svn-id: http://svn.redmine.org/redmine/trunk@14243 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -47,9 +47,16 @@ class FilesController < ApplicationController
|
||||
attachments = Attachment.attach_files(container, params[:attachments])
|
||||
render_attachment_warning_if_needed(container)
|
||||
|
||||
if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added')
|
||||
Mailer.attachments_added(attachments[:files]).deliver
|
||||
if attachments[:files].present?
|
||||
if Setting.notified_events.include?('file_added')
|
||||
Mailer.attachments_added(attachments[:files]).deliver
|
||||
end
|
||||
flash[:notice] = l(:label_file_added)
|
||||
redirect_to project_files_path(@project)
|
||||
else
|
||||
flash.now[:error] = l(:label_attachment) + " " + l('activerecord.errors.messages.invalid')
|
||||
new
|
||||
render :action => 'new'
|
||||
end
|
||||
redirect_to project_files_path(@project)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user