FIX: Disable notices for posts by anonymous.

This commit is contained in:
Dan Ungureanu 2019-03-13 00:18:58 +02:00
parent 7310ee3ef1
commit 476d0050ab
No known key found for this signature in database
GPG Key ID: 0AA2A00D6ACC8B84
1 changed files with 3 additions and 1 deletions

View File

@ -370,7 +370,9 @@ class PostSerializer < BasicPostSerializer
end
def include_post_notice_type?
return false if scope.user&.id == object.user_id || !scope.user&.has_trust_level?(SiteSetting.min_post_notice_tl)
return false if !scope.user || !scope.user.id || scope.user.id == object.user_id ||
!object.user || object.user.anonymous? ||
!scope.user.has_trust_level?(SiteSetting.min_post_notice_tl)
post_notice_type.present?
end