refactor: simplify changeset checks, enable spellcheck

This commit is contained in:
Ivan R. 2024-08-29 00:38:29 +05:00
parent 7aa77b1604
commit 80743a50f7
Signed by: lumin
GPG key ID: E0937DC7CD6D3817
2 changed files with 2 additions and 6 deletions

View file

@ -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.

View file

@ -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>