diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-12-06 13:59:35 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-12-06 13:59:35 +0300 |
commit | a010c5b16a395d823a98cd088c83acd098930ade (patch) | |
tree | 082ad643a5cb30ddc9e356c2b0ce376a2fe0899b /lib/pleroma/user.ex | |
parent | e9859b68fcb9c38b2ec27a45ffe0921e8d78b5e1 (diff) | |
parent | b3ee618e0d726452248c6fa9a1830d2525b9693b (diff) | |
download | pleroma-a010c5b16a395d823a98cd088c83acd098930ade.tar.gz |
Merge remote-tracking branch 'remotes/origin/develop' into auth-improvements
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 6a5a43a25..7d5e83a7f 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -473,6 +473,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 |