Fix new credo warnings

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-11-26 14:30:46 +01:00
parent 52e624bb88
commit 51afec1856
20 changed files with 77 additions and 72 deletions

View File

@@ -56,8 +56,6 @@ defmodule Mobilizon.Service.Workers.BuildSearch do
end
defp get_tags_string(%Event{tags: tags}) do
tags
|> Enum.map(& &1.title)
|> Enum.join(" ")
Enum.map_join(tags, " ", & &1.title)
end
end

View File

@@ -77,12 +77,16 @@ defmodule Mobilizon.Service.Workers.LegacyNotifierBuilder do
) do
event_uuid
|> Events.get_event_by_uuid_with_preload()
|> (fn %Event{organizer_actor: %Actor{id: actor_id}} -> [actor_id] end).()
|> organizer_actor_id()
|> users_from_actor_ids(Keyword.fetch!(options, :author_id))
end
defp users_to_notify(_, _), do: []
defp organizer_actor_id(%Event{organizer_actor: %Actor{id: actor_id}}) do
[actor_id]
end
@spec users_from_actor_ids(list(), integer() | String.t()) :: list(Users.t())
defp users_from_actor_ids(actor_ids, author_id) do
actor_ids