From c4cdfd9857f0debb3b7156ad4c4e00a80b9400f6 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 10 Jun 2020 09:44:01 +0200 Subject: [PATCH] Currently happening events are not future events Signed-off-by: Thomas Citharel --- lib/mobilizon/events/events.ex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/mobilizon/events/events.ex b/lib/mobilizon/events/events.ex index 69be7b24a..5455b1009 100644 --- a/lib/mobilizon/events/events.ex +++ b/lib/mobilizon/events/events.ex @@ -1506,11 +1506,10 @@ defmodule Mobilizon.Events do from(e in query, where: e.draft == ^is_draft) end - # Currently happening events are also future events @spec filter_future_events(Ecto.Query.t(), boolean) :: Ecto.Query.t() defp filter_future_events(query, true) do from(q in query, - where: q.begins_on > ^DateTime.utc_now() or q.ends_on > ^DateTime.utc_now() + where: q.begins_on > ^DateTime.utc_now() ) end