diff --git a/lib/plausible/billing/quota.ex b/lib/plausible/billing/quota.ex index 569c73062..24b7406a2 100644 --- a/lib/plausible/billing/quota.ex +++ b/lib/plausible/billing/quota.ex @@ -36,9 +36,10 @@ defmodule Plausible.Billing.Quota do @limit_sites_since ~D[2021-05-05] @spec site_limit(User.t()) :: non_neg_integer() | :unlimited def site_limit(user) do - cond do - Timex.before?(user.inserted_at, @limit_sites_since) -> :unlimited - true -> get_site_limit_from_plan(user) + if Timex.before?(user.inserted_at, @limit_sites_since) do + :unlimited + else + get_site_limit_from_plan(user) end end diff --git a/lib/plausible_web/plugs/maybe_disable_registration.ex b/lib/plausible_web/plugs/maybe_disable_registration.ex index ef5ea888d..7c05a7b91 100644 --- a/lib/plausible_web/plugs/maybe_disable_registration.ex +++ b/lib/plausible_web/plugs/maybe_disable_registration.ex @@ -20,15 +20,13 @@ defmodule PlausibleWeb.Plugs.MaybeDisableRegistration do disable_registration = Keyword.fetch!(selfhost_config, :disable_registration) first_launch? = Release.should_be_first_launch?() - cond do - not first_launch? and disable_registration in disabled_for -> - conn - |> put_flash(:error, "Registration is disabled on this instance") - |> redirect(to: Routes.auth_path(conn, :login_form)) - |> halt() - - true -> - conn + if not first_launch? and disable_registration in disabled_for do + conn + |> put_flash(:error, "Registration is disabled on this instance") + |> redirect(to: Routes.auth_path(conn, :login_form)) + |> halt() + else + conn end end end diff --git a/lib/plausible_web/templates/error/server_error.html.heex b/lib/plausible_web/templates/error/server_error.html.heex index 0544c875a..24077e525 100644 --- a/lib/plausible_web/templates/error/server_error.html.heex +++ b/lib/plausible_web/templates/error/server_error.html.heex @@ -1,53 +1,73 @@
+
<%= if assigns[:trace_id] && full_build?() do %> If you would like to help, tell us what you were trying to do. Our development team will receive your report. <% else %> We have been notified. <% end %> -
-- <%= link("Home page", to: "/", class: "text-indigo-500 mr-8") %> - <%= link("Status page", to: "https://status.plausible.io", class: "mr-8 text-indigo-500") %> - <%= link("Contact us", to: "https://plausible.io/contact", class: "text-indigo-500") %> -
++ <%= link("Home page", to: "/", class: "text-indigo-500 mr-8") %> + <%= link("Status page", + to: "https://status.plausible.io", + class: "mr-8 text-indigo-500" + ) %> + <%= link("Contact us", to: "https://plausible.io/contact", class: "text-indigo-500") %> +