summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLain Soykaf <lain@lain.com>2022-12-15 18:06:28 -0500
committerLain Soykaf <lain@lain.com>2022-12-15 18:06:28 -0500
commitbb27e4134b67e406810e40bbefd99fe392c25fed (patch)
tree00ca0e10a0a6371a3fb6418694d38648fe312152
parent4a32b584e148a5625a983e0932f2a3e16fdbbf30 (diff)
AudioVideoValidator: Fix embedded attachment requirements
-rw-r--r--lib/pleroma/web/activity_pub/object_validators/audio_video_validator.ex4
-rw-r--r--test/pleroma/object/fetcher_test.exs2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/activity_pub/object_validators/audio_video_validator.ex b/lib/pleroma/web/activity_pub/object_validators/audio_video_validator.ex
index 432bd9039..671a7ef0c 100644
--- a/lib/pleroma/web/activity_pub/object_validators/audio_video_validator.ex
+++ b/lib/pleroma/web/activity_pub/object_validators/audio_video_validator.ex
@@ -104,14 +104,14 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AudioVideoValidator do
struct
|> cast(data, __schema__(:fields) -- [:attachment, :tag])
- |> cast_embed(:attachment)
+ |> cast_embed(:attachment, required: true)
|> cast_embed(:tag)
end
defp validate_data(data_cng) do
data_cng
|> validate_inclusion(:type, ["Audio", "Video"])
- |> validate_required([:id, :actor, :attributedTo, :type, :context, :attachment])
+ |> validate_required([:id, :actor, :attributedTo, :type, :context])
|> CommonValidations.validate_any_presence([:cc, :to])
|> CommonValidations.validate_fields_match([:actor, :attributedTo])
|> CommonValidations.validate_actor_presence()
diff --git a/test/pleroma/object/fetcher_test.exs b/test/pleroma/object/fetcher_test.exs
index 51541a42c..c8ad66ddb 100644
--- a/test/pleroma/object/fetcher_test.exs
+++ b/test/pleroma/object/fetcher_test.exs
@@ -166,7 +166,7 @@ defmodule Pleroma.Object.FetcherTest do
Instances.set_consistently_unreachable(id)
refute Instances.reachable?(id)
- {:ok, object} =
+ {:ok, _object} =
Fetcher.fetch_object_from_id("http://mastodon.example.org/@admin/99541947525187367")
assert Instances.reachable?(id)