Merge branch 'master' into fix-recaptcha

This commit is contained in:
Albert Yi
2017-12-13 14:33:39 -08:00
committed by GitHub
36 changed files with 396 additions and 141 deletions

View File

@@ -110,6 +110,10 @@ private
def respond_with_post_after_update(post)
respond_with(post) do |format|
format.html do
if post.warnings.any?
flash[:notice] = post.warnings.full_messages.join(".\n \n")
end
if post.errors.any?
@error_message = post.errors.full_messages.join("; ")
render :template => "static/error", :status => 500

View File

@@ -53,7 +53,12 @@ class UploadsController < ApplicationController
def create
@upload = Upload.create(params[:upload].merge(:server => Socket.gethostname))
@upload.process! if @upload.errors.empty?
if @upload.errors.empty?
post = @upload.process!
flash[:notice] = post.warnings.full_messages.join(".\n \n") if post.present? && post.warnings.any?
end
save_recent_tags
respond_with(@upload)
end