mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 01:25:06 +08:00
FIX: serialize current user fields in standard user serializer
This commit is contained in:
parent
d97b2382e6
commit
c82b33600a
|
@ -333,8 +333,13 @@ class UserSerializer < BasicUserSerializer
|
||||||
def custom_fields
|
def custom_fields
|
||||||
fields = nil
|
fields = nil
|
||||||
|
|
||||||
|
if scope.can_edit?(object)
|
||||||
|
fields = DiscoursePluginRegistry.serialized_current_user_fields.to_a
|
||||||
|
end
|
||||||
|
|
||||||
if SiteSetting.public_user_custom_fields.present?
|
if SiteSetting.public_user_custom_fields.present?
|
||||||
fields = SiteSetting.public_user_custom_fields.split('|')
|
fields ||= []
|
||||||
|
fields += SiteSetting.public_user_custom_fields.split('|')
|
||||||
end
|
end
|
||||||
|
|
||||||
if fields.present?
|
if fields.present?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user