Partial fix for #1520
This commit is contained in:
@@ -207,12 +207,7 @@ class Artist < ActiveRecord::Base
|
|||||||
CurrentUser.without_safe_mode do
|
CurrentUser.without_safe_mode do
|
||||||
begin
|
begin
|
||||||
Post.tag_match(name).each do |post|
|
Post.tag_match(name).each do |post|
|
||||||
begin
|
post.ban!
|
||||||
post.flag!("Artist requested removal")
|
|
||||||
rescue PostFlag::Error
|
|
||||||
# swallow
|
|
||||||
end
|
|
||||||
post.delete!(:ban => true)
|
|
||||||
end
|
end
|
||||||
rescue Post::SearchError
|
rescue Post::SearchError
|
||||||
# swallow
|
# swallow
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<p style="font-weight: bold;">Note: If the reason you are planning to delete this post is because it is from a banned artist, please <%= link_to "ban", confirm_ban_moderator_post_post_path(@post) %> this post instead of deleting it.</p>
|
||||||
|
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<label for="reason">Reason</label>
|
<label for="reason">Reason</label>
|
||||||
<%= text_area_tag "reason" %>
|
<%= text_area_tag "reason" %>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Duplicate: just parent to the original</li>
|
<li>Duplicate: just parent to the original</li>
|
||||||
|
<li>Banned artist: request that a member of site staff ban this post instead</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Enter a reason:</p>
|
<p>Enter a reason:</p>
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ class ArtistTest < ActiveSupport::TestCase
|
|||||||
assert(@post.is_banned?)
|
assert(@post.is_banned?)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "delete the post" do
|
should "not delete the post" do
|
||||||
assert(@post.is_deleted?)
|
refute(@post.is_deleted?)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "create a new tag implication" do
|
should "create a new tag implication" do
|
||||||
|
|||||||
Reference in New Issue
Block a user