diff options
author | eal <eal@waifu.club> | 2018-02-24 08:37:13 +0000 |
---|---|---|
committer | eal <eal@waifu.club> | 2018-02-24 08:37:13 +0000 |
commit | 3ecdab0911e061ec569fcd616c756ece9782a71b (patch) | |
tree | 381997efa04f0670ff41531871cc5a048642dc41 /lib | |
parent | e98aeabbdebee8f6c9a10d0c9e3f48c1031172cb (diff) | |
parent | ec07e087bcef49c9d2766df3c0ad9e6767720013 (diff) | |
download | pleroma-3ecdab0911e061ec569fcd616c756ece9782a71b.tar.gz pleroma-3ecdab0911e061ec569fcd616c756ece9782a71b.zip |
Merge branch 'develop' into 'develop'
Make user bio optional
See merge request pleroma/pleroma!68
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/user.ex | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 81cec8265..59f6340b8 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -93,7 +93,7 @@ defmodule Pleroma.User do |> cast(params, [:bio, :name]) |> unique_constraint(:nickname) |> validate_format(:nickname, ~r/^[a-zA-Z\d]+$/) - |> validate_length(:bio, min: 1, max: 1000) + |> validate_length(:bio, max: 1000) |> validate_length(:name, min: 1, max: 100) end @@ -119,13 +119,13 @@ defmodule Pleroma.User do def register_changeset(struct, params \\ %{}) do changeset = struct |> cast(params, [:bio, :email, :name, :nickname, :password, :password_confirmation]) - |> validate_required([:bio, :email, :name, :nickname, :password, :password_confirmation]) + |> validate_required([:email, :name, :nickname, :password, :password_confirmation]) |> validate_confirmation(:password) |> unique_constraint(:email) |> unique_constraint(:nickname) |> validate_format(:nickname, ~r/^[a-zA-Z\d]+$/) |> validate_format(:email, @email_regex) - |> validate_length(:bio, min: 1, max: 1000) + |> validate_length(:bio, max: 1000) |> validate_length(:name, min: 1, max: 100) if changeset.valid? do |