pipeline_test: Fix usage of %Activity{}
This commit is contained in:
parent
9015df2229
commit
5ae27c8451
3 changed files with 19 additions and 8 deletions
|
|
@ -169,7 +169,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidator do
|
|||
|
||||
def cast_and_apply(o), do: {:error, {:validator_not_set, o}}
|
||||
|
||||
# is_struct/1 isn't present in Elixir 1.8.x
|
||||
# is_struct/1 appears in Elixir 1.11
|
||||
def stringify_keys(%{__struct__: _} = object) do
|
||||
object
|
||||
|> Map.from_struct()
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ defmodule Pleroma.Web.ActivityPub.Pipeline do
|
|||
end
|
||||
end
|
||||
|
||||
def do_common_pipeline(%{__struct__: _}, _meta), do: {:error, :is_struct}
|
||||
|
||||
def do_common_pipeline(object, meta) do
|
||||
with {_, {:ok, validated_object, meta}} <-
|
||||
{:validate_object, @object_validator.validate(object, meta)},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue