FIX: Disable notices for posts by anonymous.
This commit is contained in:
parent
7310ee3ef1
commit
476d0050ab
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue