Display expunge errors #2556

This commit is contained in:
Toks
2015-12-05 16:18:49 -05:00
parent cd8bc87fa4
commit af22c2b7fa
2 changed files with 9 additions and 1 deletions

View File

@@ -38,6 +38,8 @@ module Moderator
def expunge
@post = ::Post.find(params[:id])
@post.expunge!
rescue StandardError => x
@error = x
end
def confirm_ban

View File

@@ -1 +1,7 @@
Danbooru.notice("Post was permanently deleted");
<% if @post.errors.any? %>
Danbooru.error("<%= j @post.errors.full_messages.join('; ') %>");
<% elsif @error %>
Danbooru.error("<%= j @error.to_s %>");
<% else %>
Danbooru.notice("Post was permanently deleted");
<% end %>