Merge branch 'accept-tags-2.5' into 'develop'

TagValidator: Drop unrecognized Tag types

Closes #2952

See merge request pleroma/pleroma!3823
This commit is contained in:
Haelwenn 2023-05-17 19:04:51 +00:00
commit 0524e66a05
3 changed files with 51 additions and 0 deletions

View file

@ -68,6 +68,12 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.TagValidator do
|> validate_required([:type, :name, :icon])
end
def changeset(struct, %{"type" => _} = data) do
struct
|> cast(data, [])
|> Map.put(:action, :ignore)
end
def icon_changeset(struct, data) do
struct
|> cast(data, [:type, :url])