Post#is_approvable?: fix 'Approve' link appearing on approver's own uploads.

Fixes the 'Approve' link in the modqueue and in the quickmod bar being
shown as available on the approver's own flagged uploads, even though
they can't actually approve these posts.
This commit is contained in:
evazion
2018-08-25 11:12:37 -05:00
parent 847237980b
commit e33d6f9e84

View File

@@ -289,7 +289,7 @@ class Post < ApplicationRecord
module ApprovalMethods
def is_approvable?(user = CurrentUser.user)
!is_status_locked? && (is_pending? || is_flagged? || is_deleted?) && !approved_by?(user)
!is_status_locked? && (is_pending? || is_flagged? || is_deleted?) && uploader != user && !approved_by?(user)
end
def flag!(reason, options = {})