FIX: do not show full name on summary page unless the setting is enabled

This commit is contained in:
Arpit Jalan 2019-01-14 07:00:44 +05:30
parent 098b6d9364
commit 08d21cc758
1 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,10 @@ class UserSummarySerializer < ApplicationSerializer
class UserWithCountSerializer < ApplicationSerializer
attributes :id, :username, :name, :count, :avatar_template
def include_name?
SiteSetting.enable_names?
end
def avatar_template
User.avatar_template(object[:username], object[:uploaded_avatar_id])
end