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

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

diff --git a/app/serializers/user_summary_serializer.rb b/app/serializers/user_summary_serializer.rb
index cf09cde..c2c104e 100644
--- a/app/serializers/user_summary_serializer.rb
+++ b/app/serializers/user_summary_serializer.rb
@@ -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

GitHub sha: 08d21cc7

1 Like