mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-27 08:16:16 +00:00
Merge branch 'user_info_fixes_again' into 'develop'
User info fixes again See merge request pleroma/pleroma!489
This commit is contained in:
commit
e1204c6f25
|
@ -4,3 +4,4 @@ CREATE DATABASE pleroma_dev OWNER pleroma;
|
|||
--Extensions made by ecto.migrate that need superuser access
|
||||
CREATE EXTENSION IF NOT EXISTS citext;
|
||||
CREATE EXTENSION IF NOT EXISTS pg_trgm;
|
||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||
|
|
|
@ -4,7 +4,7 @@ defmodule Pleroma.User.Info do
|
|||
|
||||
embedded_schema do
|
||||
field(:banner, :map, default: %{})
|
||||
field(:background, :string, default: nil)
|
||||
field(:background, :map, default: %{})
|
||||
field(:source_data, :map, default: %{})
|
||||
field(:note_count, :integer, default: 0)
|
||||
field(:follower_count, :integer, default: 0)
|
||||
|
@ -134,7 +134,8 @@ defmodule Pleroma.User.Info do
|
|||
:locked,
|
||||
:no_rich_text,
|
||||
:default_scope,
|
||||
:banner
|
||||
:banner,
|
||||
:background
|
||||
])
|
||||
end
|
||||
|
||||
|
|
|
@ -337,7 +337,7 @@ defmodule Pleroma.Web.OStatusTest do
|
|||
%Pleroma.User.Info{
|
||||
id: user.info.id,
|
||||
ap_enabled: false,
|
||||
background: nil,
|
||||
background: %{},
|
||||
banner: %{},
|
||||
blocks: [],
|
||||
deactivated: false,
|
||||
|
|
|
@ -24,6 +24,9 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
|
|||
|> assign(:user, user)
|
||||
|> post(authenticated_twitter_api__path(conn, :update_banner), %{"banner" => new_banner})
|
||||
|> json_response(200)
|
||||
|
||||
user = Repo.get(User, user.id)
|
||||
assert user.info.banner["type"] == "Image"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -39,6 +42,9 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
|
|||
|> assign(:user, user)
|
||||
|> post(authenticated_twitter_api__path(conn, :update_background), %{"img" => new_bg})
|
||||
|> json_response(200)
|
||||
|
||||
user = Repo.get(User, user.id)
|
||||
assert user.info.background["type"] == "Image"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue