mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 01:55:02 +08:00
Revert "Revert "Preload custom user fields when viewing flag queue""
This reverts commit 1bb12ee1b6f0c5428a046bb01a2c12f969cc6480.
This commit is contained in:
@ -3,7 +3,8 @@ class FlaggedUserSerializer < BasicUserSerializer
|
||||
:can_be_deleted,
|
||||
:post_count,
|
||||
:topic_count,
|
||||
:ip_address
|
||||
:ip_address,
|
||||
:custom_fields
|
||||
|
||||
def can_delete_all_posts
|
||||
scope.can_delete_all_posts?(object)
|
||||
@ -17,4 +18,19 @@ class FlaggedUserSerializer < BasicUserSerializer
|
||||
object.ip_address.try(:to_s)
|
||||
end
|
||||
|
||||
def custom_fields
|
||||
fields = User.whitelisted_user_custom_fields(scope)
|
||||
|
||||
if scope.can_edit?(object)
|
||||
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?
|
||||
end
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user