aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2020-07-27 15:13:34 -0500
committerAlex Gleason <alex@alexgleason.me>2020-07-27 15:13:34 -0500
commit6f44a0ee84a8dca7a94a38b45493a444390f13ec (patch)
treea031a623da5257fff10d6421fe9a514285ebf702 /lib
parent6747bf2e1642d7715a9f08469247bc99ff7165cb (diff)
downloadpleroma-6f44a0ee84a8dca7a94a38b45493a444390f13ec.tar.gz
Add configurable registration_reason limit
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/user.ex2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
index a78123fe4..913b6afd1 100644
--- a/lib/pleroma/user.ex
+++ b/lib/pleroma/user.ex
@@ -641,6 +641,7 @@ defmodule Pleroma.User do
def register_changeset(struct, params \\ %{}, opts \\ []) do
bio_limit = Config.get([:instance, :user_bio_length], 5000)
name_limit = Config.get([:instance, :user_name_length], 100)
+ reason_limit = Config.get([:instance, :registration_reason_length], 500)
params = Map.put_new(params, :accepts_chat_messages, true)
need_confirmation? =
@@ -681,6 +682,7 @@ defmodule Pleroma.User do
|> validate_format(:email, @email_regex)
|> validate_length(:bio, max: bio_limit)
|> validate_length(:name, min: 1, max: name_limit)
+ |> validate_length(:registration_reason, max: reason_limit)
|> maybe_validate_required_email(opts[:external])
|> put_password_hash
|> put_ap_id()