mirror of
https://github.com/discourse/discourse.git
synced 2025-06-18 01:12:30 +08:00
Revert "Preload custom user fields when viewing flag queue"
This reverts commit 5bd1c5cc95f8f78ab74342dabbaa2f6366f57a62.
This commit is contained in:
@ -3,8 +3,7 @@ class FlaggedUserSerializer < BasicUserSerializer
|
|||||||
:can_be_deleted,
|
:can_be_deleted,
|
||||||
:post_count,
|
:post_count,
|
||||||
:topic_count,
|
:topic_count,
|
||||||
:ip_address,
|
:ip_address
|
||||||
:custom_fields
|
|
||||||
|
|
||||||
def can_delete_all_posts
|
def can_delete_all_posts
|
||||||
scope.can_delete_all_posts?(object)
|
scope.can_delete_all_posts?(object)
|
||||||
@ -18,19 +17,4 @@ class FlaggedUserSerializer < BasicUserSerializer
|
|||||||
object.ip_address.try(:to_s)
|
object.ip_address.try(:to_s)
|
||||||
end
|
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
|
end
|
||||||
|
@ -129,13 +129,10 @@ module FlagQuery
|
|||||||
# TODO: add serializer so we can skip this
|
# TODO: add serializer so we can skip this
|
||||||
posts.map!(&:marshal_dump)
|
posts.map!(&:marshal_dump)
|
||||||
|
|
||||||
users = User.includes(:user_stat).where(id: user_ids.to_a).to_a
|
|
||||||
User.preload_custom_fields(users, User.whitelisted_user_custom_fields(guardian))
|
|
||||||
|
|
||||||
[
|
[
|
||||||
posts,
|
posts,
|
||||||
Topic.with_deleted.where(id: topic_ids.to_a).to_a,
|
Topic.with_deleted.where(id: topic_ids.to_a).to_a,
|
||||||
users,
|
User.includes(:user_stat).where(id: user_ids.to_a).to_a,
|
||||||
all_post_actions,
|
all_post_actions,
|
||||||
total_rows
|
total_rows
|
||||||
]
|
]
|
||||||
|
Reference in New Issue
Block a user