diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex index 8172a81fb..cbb57aee6 100644 --- a/lib/pleroma/web/mastodon_api/views/account_view.ex +++ b/lib/pleroma/web/mastodon_api/views/account_view.ex @@ -240,19 +240,21 @@ defp do_render("show.json", %{user: user} = opts) do %{} end - instance = with {:ok, instance} <- Pleroma.Instances.Instance.get_cached_by_url(user.ap_id) do - instance - else - _ -> + instance = + with {:ok, instance} <- Pleroma.Instances.Instance.get_cached_by_url(user.ap_id) do + instance + else + _ -> nil - end + end - favicon = if is_nil(instance) do - nil - else - instance.favicon - |> MediaProxy.url() - end + favicon = + if is_nil(instance) do + nil + else + instance.favicon + |> MediaProxy.url() + end %{ id: to_string(user.id), diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index 8bb192bad..b3a35526e 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -421,7 +421,6 @@ def render("show.json", _) do nil end - def render("history.json", %{activity: %{data: %{"object" => _object}} = activity} = opts) do object = Object.normalize(activity, fetch: false) diff --git a/lib/pleroma/workers/worker_helper.ex b/lib/pleroma/workers/worker_helper.ex index ed13a96a9..4befbeb3b 100644 --- a/lib/pleroma/workers/worker_helper.ex +++ b/lib/pleroma/workers/worker_helper.ex @@ -41,7 +41,7 @@ def enqueue(op, params, worker_args \\ []) do unquote(caller_module) |> apply(:new, [params, worker_args]) - |> Oban.insert()\ + |> Oban.insert() end end end diff --git a/test/pleroma/web/activity_pub/side_effects_test.exs b/test/pleroma/web/activity_pub/side_effects_test.exs index 94c0836f2..ee664bb8f 100644 --- a/test/pleroma/web/activity_pub/side_effects_test.exs +++ b/test/pleroma/web/activity_pub/side_effects_test.exs @@ -43,7 +43,10 @@ test "it queues a fetch of instance information" do {:ok, _create_activity, _meta} = SideEffects.handle(create_activity, local: false, object_data: note_data) - assert_enqueued(worker: Pleroma.Workers.NodeInfoFetcherWorker, args: %{"op" => "process", "source_url" => "https://wowee.example.com/users/1"}) + assert_enqueued( + worker: Pleroma.Workers.NodeInfoFetcherWorker, + args: %{"op" => "process", "source_url" => "https://wowee.example.com/users/1"} + ) end end