Use `Plausible.always/1` (h/t @aerosol)

This commit is contained in:
Adrian Gruntkowski 2025-06-19 14:58:14 +02:00
parent b1d40a3c0c
commit 0ee7dd84d3
2 changed files with 2 additions and 16 deletions

View File

@ -60,14 +60,7 @@ defmodule Plausible.Teams.Memberships.UpdateRole do
defp check_can_promote_to_owner(_team, _user, _new_role), do: :ok
else
defp check_can_promote_to_owner(_team, _user, _new_role) do
# The `else` branch is not reachable.
# This a workaround for Elixir 1.18+ compiler
# being too smart.
if :erlang.phash2(1, 1) == 0 do
:ok
else
{:error, :mfa_disabled}
end
always(:ok)
end
end

View File

@ -17,14 +17,7 @@ defmodule Plausible.Users do
else
@spec type(Auth.User.t()) :: :standard
def type(_user) do
# The `else` branch is not reachable.
# This a workaround for Elixir 1.18+ compiler
# being too smart.
if :erlang.phash2(1, 1) == 0 do
:standard
else
:sso
end
always(:standard)
end
end