Actually fix verified_at
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
0ab061f375
commit
d4904b392a
2 changed files with 6 additions and 3 deletions
|
@ -2713,10 +2713,11 @@ def sanitize_html(%User{} = user) do
|
||||||
# - display name
|
# - display name
|
||||||
def sanitize_html(%User{} = user, filter) do
|
def sanitize_html(%User{} = user, filter) do
|
||||||
fields =
|
fields =
|
||||||
Enum.map(user.fields, fn %{"name" => name, "value" => value} ->
|
Enum.map(user.fields, fn %{"name" => name, "value" => value} = field ->
|
||||||
%{
|
%{
|
||||||
"name" => name,
|
"name" => name,
|
||||||
"value" => HTML.filter_tags(value, Pleroma.HTML.Scrubber.LinksOnly)
|
"value" => HTML.filter_tags(value, Pleroma.HTML.Scrubber.LinksOnly),
|
||||||
|
"verified_at" => Map.get(field, "verified_at")
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
|
@ -259,7 +259,9 @@ def update_credentials(%{assigns: %{user: user}, body_params: params} = conn, _p
|
||||||
|
|
||||||
defp normalize_fields_attributes(fields) do
|
defp normalize_fields_attributes(fields) do
|
||||||
if Enum.all?(fields, &is_tuple/1) do
|
if Enum.all?(fields, &is_tuple/1) do
|
||||||
Enum.map(fields, fn {_, v} -> v end)
|
Enum.map(fields, fn {_, %{} = field} ->
|
||||||
|
%{"name" => field["name"], "value" => field["value"]}
|
||||||
|
end)
|
||||||
else
|
else
|
||||||
Enum.map(fields, fn
|
Enum.map(fields, fn
|
||||||
%{} = field -> %{"name" => field.name, "value" => field.value}
|
%{} = field -> %{"name" => field.name, "value" => field.value}
|
||||||
|
|
Loading…
Reference in a new issue