Skip to content

Commit

Permalink
remove @plausible.io contacts from CE (#4766)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslandoga committed Dec 6, 2024
1 parent 83106b6 commit 0a3da00
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/plausible/site.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 [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
Expand Down
12 changes: 12 additions & 0 deletions test/plausible_web/controllers/site_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =~ "[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
Expand All @@ -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) =~ "[email protected]"
else
refute html_response(conn, 200) =~ "[email protected]"
end
end

test "allows creating the site if domain was changed by the owner", %{
Expand Down

0 comments on commit 0a3da00

Please sign in to comment.