mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FIX: Various fixes to support posts with no user (#8877)
* Do not grant badges for posts with no user * Ensure instructions are correct in Change Owner modal * Hide user-dependent actions from posts with no user * Make PostRevisor work with posts with no user * Ensure posts with no user can be deleted * discourse-narrative-bot should ignore posts with no user * Skip TopicLink creation for posts with no user
This commit is contained in:
@ -56,7 +56,7 @@ class CookedPostProcessor
|
||||
end
|
||||
|
||||
def grant_badges
|
||||
return unless Guardian.new.can_see?(@post)
|
||||
return if @post.user.blank? || !Guardian.new.can_see?(@post)
|
||||
|
||||
BadgeGranter.grant(Badge.find(Badge::FirstEmoji), @post.user, post_id: @post.id) if has_emoji?
|
||||
BadgeGranter.grant(Badge.find(Badge::FirstOnebox), @post.user, post_id: @post.id) if @has_oneboxes
|
||||
|
Reference in New Issue
Block a user