Add fallback value to the admin report view.
This is to avoid 500 error when the reported user no longer exists in the database.
This commit is contained in:
parent
79c88a257f
commit
ab50c6b3ca
2 changed files with 19 additions and 1 deletions
|
|
@ -46,8 +46,10 @@ defmodule Pleroma.Web.AdminAPI.ReportView do
|
|||
}
|
||||
end
|
||||
|
||||
defp merge_account_views(user) do
|
||||
defp merge_account_views(%User{} = user) do
|
||||
Pleroma.Web.MastodonAPI.AccountView.render("account.json", %{user: user})
|
||||
|> Map.merge(Pleroma.Web.AdminAPI.AccountView.render("show.json", %{user: user}))
|
||||
end
|
||||
|
||||
defp merge_account_views(_), do: %{}
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue