uploads: fix tag warnings not being shown after upload.

Fix the warnings about not having enough tags, or not having an artist
or copyright tag, not being shown after creating a new post.
This commit is contained in:
evazion
2022-01-30 22:36:54 -06:00
parent 4ad554e28b
commit 2fe058eccf

View File

@@ -68,6 +68,10 @@ class PostsController < ApplicationController
@post.save
if @post.errors.none?
if @post.warnings.any?
flash[:notice] = @post.warnings.full_messages.join(".\n \n")
end
respond_with(@post)
elsif @post.errors.of_kind?(:md5, :taken)
@original_post = Post.find_by!(md5: @post.md5)