mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +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
|
||||
changeset
|
||||
|> 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)
|
||||
|> unsafe_validate_unique(:email, Philomena.Repo)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue