Fix duplicate events on homepage

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-10-01 17:51:07 +02:00
parent 32ff3cb69b
commit e068326c4b
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -356,7 +356,7 @@ defmodule Mobilizon.Events do
direction \\ :asc, direction \\ :asc,
is_future \\ true is_future \\ true
) do ) do
query = from(e in Event, preload: [:organizer_actor, :participants]) query = from(e in Event, distinct: true, preload: [:organizer_actor, :participants])
query query
|> sort(sort, direction) |> sort(sort, direction)