Partial fix for #1520

This commit is contained in:
Toks
2014-01-08 15:54:27 -05:00
parent 259b7fcf0e
commit f4596830c4
4 changed files with 6 additions and 8 deletions

View File

@@ -207,12 +207,7 @@ class Artist < ActiveRecord::Base
CurrentUser.without_safe_mode do
begin
Post.tag_match(name).each do |post|
begin
post.flag!("Artist requested removal")
rescue PostFlag::Error
# swallow
end
post.delete!(:ban => true)
post.ban!
end
rescue Post::SearchError
# swallow

View File

@@ -14,6 +14,8 @@
</div>
<% 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">
<label for="reason">Reason</label>
<%= text_area_tag "reason" %>

View File

@@ -15,6 +15,7 @@
<ul>
<li>Duplicate: just parent to the original</li>
<li>Banned artist: request that a member of site staff ban this post instead</li>
</ul>
<p>Enter a reason:</p>

View File

@@ -41,8 +41,8 @@ class ArtistTest < ActiveSupport::TestCase
assert(@post.is_banned?)
end
should "delete the post" do
assert(@post.is_deleted?)
should "not delete the post" do
refute(@post.is_deleted?)
end
should "create a new tag implication" do