diff --git a/lib/plausible_web/controllers/site/membership_controller.ex b/lib/plausible_web/controllers/site/membership_controller.ex index 0f95815487f1..aed8b695ea2b 100644 --- a/lib/plausible_web/controllers/site/membership_controller.ex +++ b/lib/plausible_web/controllers/site/membership_controller.ex @@ -140,11 +140,12 @@ defmodule PlausibleWeb.Site.MembershipController do message = case errors do - %{invitation: [error | _]} -> String.capitalize(error) + %{invitation: ["already sent" | _]} -> "Invitation has already been sent" _other -> "Site transfer request to #{email} has failed" end conn + |> put_flash(:ttl, :timer.seconds(5)) |> put_flash(:error_title, "Transfer error") |> put_flash(:error, message) end diff --git a/test/plausible_web/controllers/site/membership_controller_test.exs b/test/plausible_web/controllers/site/membership_controller_test.exs index 98081e13d462..da68aca80dd7 100644 --- a/test/plausible_web/controllers/site/membership_controller_test.exs +++ b/test/plausible_web/controllers/site/membership_controller_test.exs @@ -232,7 +232,7 @@ defmodule PlausibleWeb.Site.MembershipControllerTest do conn = get(recycle(conn), redirected_to(conn, 302)) html = html_response(conn, 200) assert html =~ "Transfer error" - assert html =~ "Already sent" + assert html =~ "Invitation has already been sent" end end