FIX: properly retrieve user custom fields

This commit is contained in:
Arpit Jalan 2018-06-14 07:32:43 +05:30
parent 276526e30e
commit 94ae89f61f
1 changed files with 4 additions and 5 deletions

View File

@ -25,12 +25,11 @@ class FlaggedUserSerializer < BasicUserSerializer
fields += DiscoursePluginRegistry.serialized_current_user_fields.to_a
end
result = {}
fields.each do |k|
result[k] = object.custom_fields[k] if object.custom_fields[k].present?
if fields.present?
User.custom_fields_for_ids([object.id], fields)[object.id] || {}
else
{}
end
result
end
end