mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +01:00
format
This commit is contained in:
parent
ad1963e57c
commit
da17726fc5
1 changed files with 3 additions and 1 deletions
|
@ -161,7 +161,9 @@ defmodule Philomena.Users.User do
|
||||||
defp validate_email(changeset) do
|
defp validate_email(changeset) do
|
||||||
changeset
|
changeset
|
||||||
|> validate_required([:email])
|
|> validate_required([:email])
|
||||||
|> validate_format(:email, ~r/^[^\s]+@[^\s]+\.[^\s]+$/, message: "must be valid (e.g., user@example.com)")
|
|> validate_format(:email, ~r/^[^\s]+@[^\s]+\.[^\s]+$/,
|
||||||
|
message: "must be valid (e.g., user@example.com)"
|
||||||
|
)
|
||||||
|> validate_length(:email, max: 160)
|
|> validate_length(:email, max: 160)
|
||||||
|> unsafe_validate_unique(:email, Philomena.Repo)
|
|> unsafe_validate_unique(:email, Philomena.Repo)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue