Fix #4603: Total Upload Limit Being Reduced After A Failed Appeal
This commit is contained in:
@@ -1003,7 +1003,7 @@ class Post < ApplicationRecord
|
||||
# XXX This must happen *after* the `is_deleted` flag is set to true (issue #3419).
|
||||
give_favorites_to_parent if move_favorites
|
||||
|
||||
uploader.upload_limit.update_limit!(self, incremental: automated)
|
||||
uploader.upload_limit.update_limit!(is_pending?, false)
|
||||
|
||||
unless automated
|
||||
ModAction.log("deleted post ##{id}, reason: #{reason}", :post_delete)
|
||||
|
||||
@@ -26,6 +26,7 @@ class PostApproval < ApplicationRecord
|
||||
end
|
||||
|
||||
def approve_post
|
||||
is_pending = post.is_pending
|
||||
is_undeletion = post.is_deleted
|
||||
|
||||
post.flags.pending.update!(status: :rejected)
|
||||
@@ -34,7 +35,7 @@ class PostApproval < ApplicationRecord
|
||||
post.update(approver: user, is_flagged: false, is_pending: false, is_deleted: false)
|
||||
ModAction.log("undeleted post ##{post_id}", :post_undelete) if is_undeletion
|
||||
|
||||
post.uploader.upload_limit.update_limit!(post, incremental: !is_undeletion)
|
||||
post.uploader.upload_limit.update_limit!(is_pending, true)
|
||||
end
|
||||
|
||||
def self.search(params)
|
||||
|
||||
Reference in New Issue
Block a user