mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Only render group card if user title is from group (#9946)
This was failing when a user with a primary_group chose to display a title coming from a badge.
This commit is contained in:
@@ -47,6 +47,7 @@ class PostSerializer < BasicPostSerializer
|
||||
:link_counts,
|
||||
:read,
|
||||
:user_title,
|
||||
:title_is_group,
|
||||
:reply_to_user,
|
||||
:bookmarked,
|
||||
:bookmark_reminder_at,
|
||||
@@ -212,6 +213,14 @@ class PostSerializer < BasicPostSerializer
|
||||
object&.user&.title
|
||||
end
|
||||
|
||||
def title_is_group
|
||||
object&.user&.title == object.user&.primary_group&.title
|
||||
end
|
||||
|
||||
def include_title_is_group?
|
||||
object&.user&.title.present?
|
||||
end
|
||||
|
||||
def trust_level
|
||||
object&.user&.trust_level
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user