mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 00:26:30 +00:00
Fix formatter tests.
This commit is contained in:
parent
fbb70d25fe
commit
2887f4ff1d
3 changed files with 10 additions and 5 deletions
|
@ -87,7 +87,7 @@ defmodule Pleroma.User do
|
|||
info_cng = User.Info.remote_user_creation(%User.Info{}, params[:info])
|
||||
|
||||
changes =
|
||||
%User{info: %{}}
|
||||
%User{}
|
||||
|> cast(params, [:bio, :name, :ap_id, :nickname, :avatar])
|
||||
|> validate_required([:name, :ap_id])
|
||||
|> unique_constraint(:nickname)
|
||||
|
@ -718,7 +718,7 @@ defmodule Pleroma.User do
|
|||
user
|
||||
else
|
||||
changes =
|
||||
%User{info: %{}}
|
||||
%User{info: %User.Info{}}
|
||||
|> cast(%{}, [:ap_id, :nickname, :local])
|
||||
|> put_change(:ap_id, relay_uri)
|
||||
|> put_change(:nickname, nil)
|
||||
|
@ -763,9 +763,9 @@ defmodule Pleroma.User do
|
|||
data =
|
||||
data
|
||||
|> Map.put(:name, blank?(data[:name]) || data[:nickname])
|
||||
|> Map.put(:info, data[:info] || %{})
|
||||
|
||||
cs = User.remote_user_creation(data)
|
||||
|
||||
Repo.insert(cs, on_conflict: :replace_all, conflict_target: :nickname)
|
||||
end
|
||||
|
||||
|
|
|
@ -89,7 +89,12 @@ defmodule Pleroma.User.Info do
|
|||
|
||||
def remote_user_creation(info, params) do
|
||||
info
|
||||
|> cast(params, [:source_data])
|
||||
|> cast(params, [
|
||||
:ap_enabled,
|
||||
:source_data,
|
||||
:banner,
|
||||
:locked
|
||||
])
|
||||
end
|
||||
|
||||
# Receives data from user_data_from_user_object
|
||||
|
|
|
@ -110,7 +110,7 @@ defmodule Pleroma.FormatterTest do
|
|||
archaeme =
|
||||
insert(:user, %{
|
||||
nickname: "archaeme",
|
||||
info: %{"source_data" => %{"url" => "https://archeme/@archaeme"}}
|
||||
info: %Pleroma.User.Info{source_data: %{"url" => "https://archeme/@archaeme"}}
|
||||
})
|
||||
|
||||
archaeme_remote = insert(:user, %{nickname: "archaeme@archae.me"})
|
||||
|
|
Loading…
Reference in a new issue