FIX: serialize current user fields in standard user serializer

This commit is contained in:
Sam 2015-12-05 17:50:03 +11:00
parent d97b2382e6
commit c82b33600a

View file

@ -333,8 +333,13 @@ class UserSerializer < BasicUserSerializer
def custom_fields
fields = nil
if scope.can_edit?(object)
fields = DiscoursePluginRegistry.serialized_current_user_fields.to_a
end
if SiteSetting.public_user_custom_fields.present?
fields = SiteSetting.public_user_custom_fields.split('|')
fields ||= []
fields += SiteSetting.public_user_custom_fields.split('|')
end
if fields.present?