projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
maintenance: dependency upgrade (#81)
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
object_validators
/
attachment_validator.ex
diff --git
a/lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex
b/lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex
index 59fef42d6cc8c1b7b7046d623f95dfce75014b14..ffdb16976f30263fc71b7f7dea9592eff4d5b4e3 100644
(file)
--- a/
lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex
+++ b/
lib/pleroma/web/activity_pub/object_validators/attachment_validator.ex
@@
-44,9
+44,9
@@
defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidator do
struct
|> cast(data, [:type, :mediaType, :name, :blurhash])
struct
|> cast(data, [:type, :mediaType, :name, :blurhash])
- |> cast_embed(:url, with: &url_changeset/2)
+ |> cast_embed(:url, with: &url_changeset/2
, required: true
)
|> validate_inclusion(:type, ~w[Link Document Audio Image Video])
|> validate_inclusion(:type, ~w[Link Document Audio Image Video])
- |> validate_required([:type, :mediaType
, :url
])
+ |> validate_required([:type, :mediaType])
end
def url_changeset(struct, data) do
end
def url_changeset(struct, data) do
@@
-96,6
+96,6
@@
defmodule Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidator do
defp validate_data(cng) do
cng
|> validate_inclusion(:type, ~w[Document Audio Image Video])
defp validate_data(cng) do
cng
|> validate_inclusion(:type, ~w[Document Audio Image Video])
- |> validate_required([:mediaType, :
url, :
type])
+ |> validate_required([:mediaType, :type])
end
end
end
end