diff --git a/app/serializers/basic_user_serializer.rb b/app/serializers/basic_user_serializer.rb index e46180c4ce5..8911291f369 100644 --- a/app/serializers/basic_user_serializer.rb +++ b/app/serializers/basic_user_serializer.rb @@ -5,12 +5,6 @@ class BasicUserSerializer < ApplicationSerializer SiteSetting.enable_names? end - # so weird we send a hash in here sometimes and an object others - def include_uploaded_avatar_id? - SiteSetting.allow_uploaded_avatars? && - (Hash === object ? user[:uploaded_avatar_id] : object.uploaded_avatar_id) - end - def avatar_template if Hash === object User.avatar_template(user[:username], user[:uploaded_avatar_id]) diff --git a/app/serializers/post_action_user_serializer.rb b/app/serializers/post_action_user_serializer.rb index 6b791d8c630..b69a2734822 100644 --- a/app/serializers/post_action_user_serializer.rb +++ b/app/serializers/post_action_user_serializer.rb @@ -1,5 +1,5 @@ class PostActionUserSerializer < BasicUserSerializer - attributes :id, :username, :avatar_template, :post_url + attributes :post_url def id object.user.id @@ -9,6 +9,10 @@ class PostActionUserSerializer < BasicUserSerializer object.user.username end + def uploaded_avatar_id + object.user.uploaded_avatar_id + end + def avatar_template object.user.avatar_template end