Post#approve!: signal errors with invalid object instead of exception.

This commit is contained in:
evazion
2017-04-03 13:45:17 -05:00
parent db0bcf08b9
commit 70a7f77a48
4 changed files with 12 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
<% if @post.errors.any? %>
<% if @approval.errors.any? %>
Danbooru.error("Error: " + <%= @post.errors.full_messages.join("; ").to_json.html_safe %>);
Danbooru.error("Error: " + <%= @approval.errors.full_messages.join("; ").to_json.html_safe %>);
<% else %>
@@ -10,7 +10,7 @@ $("#c-posts #flag").show();
$("#pending-approval-notice").hide();
$("#c-moderator-post-queues #post-<%= @post.id %>").hide();
$("#c-moderator-post-queues #post-<%= @approval.post.id %>").hide();
Danbooru.notice("Post was approved");
Danbooru.ModQueue.increment_processed();