refactor: simplify changeset checks, enable spellcheck
This commit is contained in:
parent
7aa77b1604
commit
80743a50f7
2 changed files with 2 additions and 6 deletions
|
@ -42,7 +42,7 @@ defmodule Comfycamp.Accounts.User do
|
||||||
|> cast(attrs, [:email, :password, :info])
|
|> cast(attrs, [:email, :password, :info])
|
||||||
|> validate_email(opts)
|
|> validate_email(opts)
|
||||||
|> validate_password(opts)
|
|> validate_password(opts)
|
||||||
|> validate_info()
|
|> validate_length(:info, min: 2, max: 4096)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp validate_email(changeset, opts) do
|
defp validate_email(changeset, opts) do
|
||||||
|
@ -89,11 +89,6 @@ defmodule Comfycamp.Accounts.User do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp validate_info(changeset) do
|
|
||||||
changeset
|
|
||||||
|> validate_length(:info, max: 4096)
|
|
||||||
end
|
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
A user changeset for changing the email.
|
A user changeset for changing the email.
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ defmodule ComfycampWeb.UserRegistrationLive do
|
||||||
field={@form[:info]}
|
field={@form[:info]}
|
||||||
type="textarea"
|
type="textarea"
|
||||||
label="Почему вы хотите получить доступ?"
|
label="Почему вы хотите получить доступ?"
|
||||||
|
spellcheck="true"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
<p>
|
<p>
|
||||||
|
|
Loading…
Reference in a new issue