Post#has_artist_tag: fix "artist tag is required" triggering incorrectly.

Fixes the "Artist tag is required" upload warning to only trigger when
the source is from a first-party site.
This commit is contained in:
evazion
2018-08-28 17:04:20 -05:00
parent 31df8d9f87
commit 4f5cb0ba70

View File

@@ -1793,8 +1793,8 @@ class Post < ApplicationRecord
return if source !~ %r!\Ahttps?://!
return if has_tag?("artist_request") || has_tag?("official_art")
return if tags.any? { |t| t.category == Tag.categories.artist }
return if Sources::Strategies.find(source).is_a?(Sources::Strategies::Null)
site = Sources::Strategies.find(source)
self.warnings[:base] << "Artist tag is required. Create a new tag with [[artist:<artist_name>]]. Ask on the forum if you need naming help"
end