X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fadmin_api%2Fviews%2Faccount_view.ex;h=1e03849de035f950d73ee99bf91011b1201ba892;hb=bb49d8f5a0dbbad65a8f65a28cc2d0847b518067;hp=eed1b9fa70c5cfc263b2763ebfaf06f3894a2f42;hpb=10ff01acd95d42314b4eb923e5b7a7191356b73e;p=akkoma
diff --git a/lib/pleroma/web/admin_api/views/account_view.ex b/lib/pleroma/web/admin_api/views/account_view.ex
index eed1b9fa7..1e03849de 100644
--- a/lib/pleroma/web/admin_api/views/account_view.ex
+++ b/lib/pleroma/web/admin_api/views/account_view.ex
@@ -1,11 +1,10 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.AdminAPI.AccountView do
use Pleroma.Web, :view
- alias Pleroma.HTML
alias Pleroma.User
alias Pleroma.Web.AdminAPI.AccountView
alias Pleroma.Web.MediaProxy
@@ -18,9 +17,16 @@ defmodule Pleroma.Web.AdminAPI.AccountView do
}
end
+ def render("index.json", %{users: users}) do
+ %{
+ users: render_many(users, AccountView, "show.json", as: :user)
+ }
+ end
+
def render("show.json", %{user: user}) do
avatar = User.avatar_url(user) |> MediaProxy.url()
- display_name = HTML.strip_tags(user.name || user.nickname)
+ display_name = Pleroma.HTML.strip_tags(user.name || user.nickname)
+ user = User.sanitize_html(user, FastSanitize.Sanitizer.StripTags)
%{
"id" => user.id,
@@ -30,7 +36,8 @@ defmodule Pleroma.Web.AdminAPI.AccountView do
"deactivated" => user.deactivated,
"local" => user.local,
"roles" => User.roles(user),
- "tags" => user.tags || []
+ "tags" => user.tags || [],
+ "confirmation_pending" => user.confirmation_pending
}
end