Show better error message on duplicate domain

Co-authored-by: Marko Saric <me@markosaric.com>
pull/1762/head
Uku Taht 5 years ago
parent e27734ed79
commit e026148fb0

@ -43,7 +43,10 @@ defmodule Plausible.Site do
|> validate_format(:domain, ~r/^[a-zA-Z0-9\-\.\/\:]*$/,
message: "only letters, numbers, slashes and period allowed"
)
|> unique_constraint(:domain)
|> unique_constraint(:domain,
message:
"This domain has already been taken. Perhaps one of your team members registered it? If that's not the case, please contact support@plausible.io"
)
|> clean_domain
end

@ -259,7 +259,8 @@ defmodule PlausibleWeb.SiteControllerTest do
}
})
assert html_response(conn, 200) =~ "has already been taken"
assert html_response(conn, 200) =~
"This domain has already been taken. Perhaps one of your team members registered it? If that&#39;s not the case, please contact support@plausible.io"
end
end

Loading…
Cancel
Save