refactor(credo): Refactor to appease new credo checks (complexity and logging)

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-04-19 18:33:06 +02:00
parent 8141bb0acb
commit eda2761032
13 changed files with 169 additions and 132 deletions

View File

@@ -248,8 +248,7 @@ defmodule Mobilizon.Actors do
@spec update_actor(Actor.t(), map) :: {:ok, Actor.t()} | {:error, Ecto.Changeset.t()}
def update_actor(%Actor{preferred_username: preferred_username, domain: domain} = actor, attrs) do
if is_nil(domain) and preferred_username == "relay" do
Logger.error("Trying to update local relay actor",
attrs: attrs,
Logger.error("Trying to update local relay actor (#{inspect(attrs)})",
trace: Process.info(self(), :current_stacktrace)
)
end