mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 17:44:43 +03:00
Show better error message on duplicate domain
Co-authored-by: Marko Saric <me@markosaric.com>
This commit is contained in:
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's not the case, please contact support@plausible.io"
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user