Remove MastoFE settings from users table
This commit is contained in:
parent
8afa3f2d1b
commit
ca79aab0bf
|
@ -123,7 +123,6 @@ defmodule Pleroma.User do
|
||||||
field(:is_moderator, :boolean, default: false)
|
field(:is_moderator, :boolean, default: false)
|
||||||
field(:is_admin, :boolean, default: false)
|
field(:is_admin, :boolean, default: false)
|
||||||
field(:show_role, :boolean, default: true)
|
field(:show_role, :boolean, default: true)
|
||||||
field(:mastofe_settings, :map, default: nil)
|
|
||||||
field(:uri, ObjectValidators.Uri, default: nil)
|
field(:uri, ObjectValidators.Uri, default: nil)
|
||||||
field(:hide_followers_count, :boolean, default: false)
|
field(:hide_followers_count, :boolean, default: false)
|
||||||
field(:hide_follows_count, :boolean, default: false)
|
field(:hide_follows_count, :boolean, default: false)
|
||||||
|
@ -1702,7 +1701,6 @@ def purge_user_changeset(user) do
|
||||||
ap_enabled: false,
|
ap_enabled: false,
|
||||||
is_moderator: false,
|
is_moderator: false,
|
||||||
is_admin: false,
|
is_admin: false,
|
||||||
mastofe_settings: nil,
|
|
||||||
mascot: nil,
|
mascot: nil,
|
||||||
emoji: %{},
|
emoji: %{},
|
||||||
pleroma_settings_store: %{},
|
pleroma_settings_store: %{},
|
||||||
|
@ -2313,13 +2311,6 @@ def mascot_update(user, url) do
|
||||||
|> update_and_set_cache()
|
|> update_and_set_cache()
|
||||||
end
|
end
|
||||||
|
|
||||||
def mastodon_settings_update(user, settings) do
|
|
||||||
user
|
|
||||||
|> cast(%{mastofe_settings: settings}, [:mastofe_settings])
|
|
||||||
|> validate_required([:mastofe_settings])
|
|
||||||
|> update_and_set_cache()
|
|
||||||
end
|
|
||||||
|
|
||||||
@spec confirmation_changeset(User.t(), keyword()) :: Changeset.t()
|
@spec confirmation_changeset(User.t(), keyword()) :: Changeset.t()
|
||||||
def confirmation_changeset(user, set_confirmation: confirmed?) do
|
def confirmation_changeset(user, set_confirmation: confirmed?) do
|
||||||
params =
|
params =
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
defmodule Pleroma.Repo.Migrations.RemoveMastofeSettingsFromUsers do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
alter table(:users) do
|
||||||
|
remove_if_exists(:mastofe_settings, :map)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -1631,7 +1631,6 @@ test "delete/1 purges a user when they wouldn't be fully deleted" do
|
||||||
ap_enabled: true,
|
ap_enabled: true,
|
||||||
is_moderator: true,
|
is_moderator: true,
|
||||||
is_admin: true,
|
is_admin: true,
|
||||||
mastofe_settings: %{"a" => "b"},
|
|
||||||
mascot: %{"a" => "b"},
|
mascot: %{"a" => "b"},
|
||||||
emoji: %{"a" => "b"},
|
emoji: %{"a" => "b"},
|
||||||
pleroma_settings_store: %{"q" => "x"},
|
pleroma_settings_store: %{"q" => "x"},
|
||||||
|
@ -1673,7 +1672,6 @@ test "delete/1 purges a user when they wouldn't be fully deleted" do
|
||||||
ap_enabled: false,
|
ap_enabled: false,
|
||||||
is_moderator: false,
|
is_moderator: false,
|
||||||
is_admin: false,
|
is_admin: false,
|
||||||
mastofe_settings: nil,
|
|
||||||
mascot: nil,
|
mascot: nil,
|
||||||
emoji: %{},
|
emoji: %{},
|
||||||
pleroma_settings_store: %{},
|
pleroma_settings_store: %{},
|
||||||
|
|
Loading…
Reference in New Issue