diff options
author | lain <lain@soykaf.club> | 2020-12-23 13:35:41 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-12-23 13:35:41 +0000 |
commit | f64237927c05173e4f29dbbd2a563f123690da7e (patch) | |
tree | 9b04b38c735ba732066dcaf0323aa53c1da90622 /lib/pleroma/user.ex | |
parent | 15550f7c4bf75401d0f18add0f847f640acc6627 (diff) | |
parent | 843d2074fe79637016579c27062889a7e5371b7a (diff) | |
download | pleroma-2.2.1.tar.gz |
Merge branch 'release/2.2.1' into 'stable'v2.2.1
Release/2.2.1
See merge request pleroma/pleroma!3214
Diffstat (limited to 'lib/pleroma/user.ex')
-rw-r--r-- | lib/pleroma/user.ex | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index b56a5dfe2..0545b7445 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -462,6 +462,18 @@ defmodule Pleroma.User do |> validate_length(:bio, max: bio_limit) |> validate_length(:name, max: name_limit) |> validate_fields(true) + |> validate_non_local() + end + + defp validate_non_local(cng) do + local? = get_field(cng, :local) + + if local? do + cng + |> add_error(:local, "User is local, can't update with this changeset.") + else + cng + end end def update_changeset(struct, params \\ %{}) do |