Add :max_remote_account_fields config option

This commit is contained in:
Egor Kislitsyn 2019-08-07 18:14:22 +07:00
commit e457fcc479
7 changed files with 37 additions and 7 deletions

View file

@ -199,12 +199,12 @@ defmodule Pleroma.User do
|> validate_length(:name, min: 1, max: name_limit)
end
def upgrade_changeset(struct, params \\ %{}) do
def upgrade_changeset(struct, params \\ %{}, remote? \\ false) do
bio_limit = Pleroma.Config.get([:instance, :user_bio_length], 5000)
name_limit = Pleroma.Config.get([:instance, :user_name_length], 100)
params = Map.put(params, :last_refreshed_at, NaiveDateTime.utc_now())
info_cng = User.Info.user_upgrade(struct.info, params[:info])
info_cng = User.Info.user_upgrade(struct.info, params[:info], remote?)
struct
|> cast(params, [