Introduce basic user and profile management

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-06-11 19:13:21 +02:00
parent da4ea84baf
commit beb35a09c6
51 changed files with 1808 additions and 254 deletions

View File

@@ -10,6 +10,7 @@ defmodule Mobilizon.Service.Export.Feed do
alias Mobilizon.{Actors, Events, Users}
alias Mobilizon.Actors.Actor
alias Mobilizon.Events.{Event, FeedToken}
alias Mobilizon.Storage.Page
alias Mobilizon.Users.User
alias Mobilizon.Web.{Endpoint, MediaProxy}
@@ -148,12 +149,12 @@ defmodule Mobilizon.Service.Export.Feed do
end
defp fetch_identity_participations(%Actor{} = actor) do
with events <- Events.list_event_participations_for_actor(actor) do
events
with %Page{} = page <- Events.list_event_participations_for_actor(actor) do
page
end
end
defp participations_to_events(participations) do
defp participations_to_events(%Page{elements: participations}) do
participations
|> Enum.map(& &1.event_id)
|> Enum.map(&Events.get_event_with_preload!/1)

View File

@@ -7,6 +7,7 @@ defmodule Mobilizon.Service.Export.ICalendar do
alias Mobilizon.Actors.Actor
alias Mobilizon.Addresses.Address
alias Mobilizon.Events.{Event, FeedToken}
alias Mobilizon.Storage.Page
alias Mobilizon.Users.User
@doc """
@@ -123,7 +124,7 @@ defmodule Mobilizon.Service.Export.ICalendar do
end
end
defp participations_to_events(participations) do
defp participations_to_events(%Page{elements: participations}) do
participations
|> Enum.map(& &1.event_id)
|> Enum.map(&Events.get_event_with_preload!/1)