Use `Plausible.always/1` (h/t @aerosol)
This commit is contained in:
parent
b1d40a3c0c
commit
0ee7dd84d3
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue