summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-06-16 12:57:58 +0300
committerrinpatch <rinpatch@sdf.org>2019-06-16 13:06:12 +0300
commitbf6aa6f1a8460448d51dc69e05257058b3d56a43 (patch)
tree2b70988ac0378e2f37ab499ec29b8836b611de84 /lib
parent44de34d1706c8a15f06e86a85ce5361c5bf9e0a5 (diff)
downloadpleroma-bf6aa6f1a8460448d51dc69e05257058b3d56a43.tar.gz
pleroma-bf6aa6f1a8460448d51dc69e05257058b3d56a43.zip
Fix report content stopping to be nullable
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/admin_api/views/report_view.ex9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/pleroma/web/admin_api/views/report_view.ex b/lib/pleroma/web/admin_api/views/report_view.ex
index a17a23ca3..e7db3a8ff 100644
--- a/lib/pleroma/web/admin_api/views/report_view.ex
+++ b/lib/pleroma/web/admin_api/views/report_view.ex
@@ -24,6 +24,13 @@ defmodule Pleroma.Web.AdminAPI.ReportView do
[account_ap_id | status_ap_ids] = report.data["object"]
account = User.get_cached_by_ap_id(account_ap_id)
+ content =
+ unless is_nil(report.data["content"]) do
+ HTML.filter_tags(report.data["content"])
+ else
+ nil
+ end
+
statuses =
Enum.map(status_ap_ids, fn ap_id ->
Activity.get_by_ap_id_with_object(ap_id)
@@ -33,7 +40,7 @@ defmodule Pleroma.Web.AdminAPI.ReportView do
id: report.id,
account: AccountView.render("account.json", %{user: account}),
actor: AccountView.render("account.json", %{user: user}),
- content: HTML.filter_tags(report.data["content"]),
+ content: content,
created_at: created_at,
statuses: StatusView.render("index.json", %{activities: statuses, as: :activity}),
state: report.data["state"]