Don't crash on AP request for tombstone
Because tombstone objects has no addressing the is_public?-predicate would cause an error that propagated as a 500 error in the api
This commit is contained in:
parent
ba17518a0a
commit
2d7da5f437
3 changed files with 29 additions and 0 deletions
|
|
@ -57,6 +57,19 @@ defmodule Pleroma.Factory do
|
|||
%Pleroma.Object{data: Map.merge(data, %{"to" => [user2.ap_id]})}
|
||||
end
|
||||
|
||||
def tombstone_factory do
|
||||
data = %{
|
||||
"type" => "Tombstone",
|
||||
"id" => Pleroma.Web.ActivityPub.Utils.generate_object_id(),
|
||||
"formerType" => "Note",
|
||||
"deleted" => DateTime.utc_now() |> DateTime.to_iso8601()
|
||||
}
|
||||
|
||||
%Pleroma.Object{
|
||||
data: data
|
||||
}
|
||||
end
|
||||
|
||||
def direct_note_activity_factory do
|
||||
dm = insert(:direct_note)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue