diff --git a/lib/plausible/site.ex b/lib/plausible/site.ex index 5d0ab1391611..5b9f35736991 100644 --- a/lib/plausible/site.ex +++ b/lib/plausible/site.ex @@ -3,6 +3,7 @@ defmodule Plausible.Site do Site schema """ use Ecto.Schema + use Plausible import Ecto.Changeset alias Plausible.Auth.User alias Plausible.Site.GoogleAuth @@ -71,9 +72,15 @@ defmodule Plausible.Site do def new(params), do: changeset(%__MODULE__{}, params) - @domain_unique_error """ - This domain cannot be registered. Perhaps one of your colleagues registered it? If that's not the case, please contact support@plausible.io - """ + on_ee do + @domain_unique_error """ + This domain cannot be registered. Perhaps one of your colleagues registered it? If that's not the case, please contact support@plausible.io + """ + else + @domain_unique_error """ + This domain cannot be registered. Perhaps one of your colleagues registered it? + """ + end def changeset(site, attrs \\ %{}) do site diff --git a/test/plausible_web/controllers/site_controller_test.exs b/test/plausible_web/controllers/site_controller_test.exs index 277d2a295c9a..ec5dee748279 100644 --- a/test/plausible_web/controllers/site_controller_test.exs +++ b/test/plausible_web/controllers/site_controller_test.exs @@ -416,6 +416,12 @@ defmodule PlausibleWeb.SiteControllerTest do assert html_response(conn, 200) =~ "This domain cannot be registered. Perhaps one of your colleagues registered it?" + + if Plausible.ee?() do + assert html_response(conn, 200) =~ "support@plausible.io" + else + refute html_response(conn, 200) =~ "support@plausible.io" + end end test "renders form again when domain was changed from elsewhere", %{conn: conn} do @@ -433,6 +439,12 @@ defmodule PlausibleWeb.SiteControllerTest do assert html_response(conn, 200) =~ "This domain cannot be registered. Perhaps one of your colleagues registered it?" + + if Plausible.ee?() do + assert html_response(conn, 200) =~ "support@plausible.io" + else + refute html_response(conn, 200) =~ "support@plausible.io" + end end test "allows creating the site if domain was changed by the owner", %{