TagValidator: Drop unrecognized tags
This commit is contained in:
parent
45646ff52c
commit
5cfb0578a6
3 changed files with 12 additions and 6 deletions
|
|
@ -68,8 +68,11 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.TagValidator do
|
|||
|> validate_required([:type, :name, :icon])
|
||||
end
|
||||
|
||||
# Fallback
|
||||
def changeset(struct, data), do: cast(struct, data, [:type, :name])
|
||||
def changeset(struct, %{"type" => _} = data) do
|
||||
struct
|
||||
|> cast(data, [])
|
||||
|> Map.put(:action, :ignore)
|
||||
end
|
||||
|
||||
def icon_changeset(struct, data) do
|
||||
struct
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue