diff options
author | Lain Soykaf <lain@lain.com> | 2022-12-15 18:06:28 -0500 |
---|---|---|
committer | Lain Soykaf <lain@lain.com> | 2022-12-15 18:06:28 -0500 |
commit | bb27e4134b67e406810e40bbefd99fe392c25fed (patch) | |
tree | 00ca0e10a0a6371a3fb6418694d38648fe312152 /lib | |
parent | 4a32b584e148a5625a983e0932f2a3e16fdbbf30 (diff) | |
download | pleroma-bb27e4134b67e406810e40bbefd99fe392c25fed.tar.gz pleroma-bb27e4134b67e406810e40bbefd99fe392c25fed.zip |
AudioVideoValidator: Fix embedded attachment requirements
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/object_validators/audio_video_validator.ex | 4 |
1 files changed, 2 insertions, 2 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() |