fix credo warning for is_already_admin?
This commit is contained in:
		| @@ -422,16 +422,16 @@ defmodule Memex.Accounts do | ||||
|  | ||||
|   ## Examples | ||||
|  | ||||
|       iex> is_already_admin?(%User{role: :admin}) | ||||
|       iex> already_admin?(%User{role: :admin}) | ||||
|       true | ||||
|  | ||||
|       iex> is_already_admin?(%User{}) | ||||
|       iex> already_admin?(%User{}) | ||||
|       false | ||||
|  | ||||
|   """ | ||||
|   @spec is_already_admin?(User.t() | nil) :: boolean() | ||||
|   def is_already_admin?(%User{role: :admin}), do: true | ||||
|   def is_already_admin?(_invalid_user), do: false | ||||
|   @spec already_admin?(User.t() | nil) :: boolean() | ||||
|   def already_admin?(%User{role: :admin}), do: true | ||||
|   def already_admin?(_invalid_user), do: false | ||||
|  | ||||
|   ## Confirmation | ||||
|  | ||||
|   | ||||
| @@ -38,7 +38,7 @@ | ||||
|       <li class="mx-2 my-1 border-left border border-primary-700"></li> | ||||
|  | ||||
|       <%= if @current_user do %> | ||||
|         <li :if={@current_user |> Accounts.is_already_admin?()} class="mx-2 my-1"> | ||||
|         <li :if={@current_user |> Accounts.already_admin?()} class="mx-2 my-1"> | ||||
|           <.link navigate={~p"/invites"} class="text-primary-400 hover:underline"> | ||||
|             <%= gettext("invites") %> | ||||
|           </.link> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user