1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-25 17:28:05 +00:00

Only consider relevant events for category statistics

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-08-26 17:05:32 +02:00
parent ce38361d65
commit 8812122168
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -1632,6 +1632,10 @@ defmodule Mobilizon.Events do
def category_statistics do def category_statistics do
Event Event
|> filter_future_events(true)
|> filter_public_visibility()
|> filter_draft()
|> filter_cancelled_events()
|> filter_local_or_from_followed_instances_events() |> filter_local_or_from_followed_instances_events()
|> group_by([e], e.category) |> group_by([e], e.category)
|> select([e], {e.category, count(e.id)}) |> select([e], {e.category, count(e.id)})