Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

remove @plausible.io contacts from CE (#4766)

ruslandoga0ec8ac6d7cbf
diff --git a/lib/plausible/site.ex b/lib/plausible/site.ex
index 63cdefa488..20915c0a37 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
@@ -82,9 +83,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 [email protected]
- """
+ 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 [email protected]
+ """
+ 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 299688042e..d2b2b96a8a 100644
--- a/test/plausible_web/controllers/site_controller_test.exs
+++ b/test/plausible_web/controllers/site_controller_test.exs
@@ -408,6 +408,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) =~ "[email protected]"
+ else
+ refute html_response(conn, 200) =~ "[email protected]"
+ end
end
test "renders form again when domain was changed from elsewhere", %{conn: conn} do
@@ -425,6 +431,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) =~ "[email protected]"
+ else
+ refute html_response(conn, 200) =~ "[email protected]"
+ end
end
test "allows creating the site if domain was changed by the owner", %{