Add fallback for reports that don't have attached activities
ci/woodpecker/push/woodpecker Pipeline is pending Details

This commit is contained in:
FloatingGhost 2022-11-08 11:01:47 +00:00
parent a0b8e3c842
commit 479aacb1b6
2 changed files with 184 additions and 182 deletions

View File

@ -209,8 +209,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
end
def render("show.json", %{activity: %{data: %{"object" => _object}} = activity} = opts) do
object = Object.normalize(activity, fetch: false)
with %Object{} = object <- Object.normalize(activity, fetch: false) do
user = CommonAPI.get_user(activity.data["actor"])
user_follower_address = user.follower_address
@ -415,6 +414,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
source: object.data["source"]
}
}
else
nil -> nil
end
end
def render("show.json", _) do

View File

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.AdminAPI.ReportViewTest do
use Pleroma.DataCase, async: true
use Pleroma.DataCase, async: false
import Pleroma.Factory